2

I have a RetrieveRequest pulling subscriber status. This shows 'Active' and the subscriber is Unsubscribed on the All Subscribers list. How is this possible?

%%[
SET @rr = CreateObject("RetrieveRequest")  
SetObjectProperty(@rr, "ObjectType", "Subscriber")  
AddObjectArrayItem(@rr,"Properties","EmailAddress")  
AddObjectArrayItem(@rr,"Properties","SubscriberKey")    
SET @sfp = CreateObject("SimpleFilterPart")  
SetObjectProperty(@sfp, "Property", "SubscriberKey")  
SetObjectProperty(@sfp, "SimpleOperator", "equals")  
AddObjectArrayItem(@sfp, "Value", @email)    
SetObjectProperty(@rr, "Filter", @sfp)  
SET @sub = InvokeRetrieve(@rr)

SET @row = Row(@sub,1)   
SET @name = Field(@row ,"EmailAddress") 
SET @status = Field(@row, "Status")
]%%

%%=V(@name)=%%<br/>
%%=V(@status)=%%<br/>

I have Unsubscribed the subscribers with the LogUnsubEvent and just setting the Status to 'Unsubscribed'. Both of these Unsubscribe the subscriber from the All Subscribers list, but when I run the RetrieveRequest above the Status always returns 'Active' even when the Status in the All Subs table (in the app) shows 'Unsubscribed'.

Shows Status Active but All Subscribers Held

2 Answers 2

2

So it turns out there was a stupid error in my code. I was not retrieving the Status field in the request. I guess if you don't specify the specific field it must return a default value???

%%[
SET @rr = CreateObject("RetrieveRequest")  
SetObjectProperty(@rr, "ObjectType", "Subscriber")  
AddObjectArrayItem(@rr,"Properties","EmailAddress")  
AddObjectArrayItem(@rr,"Properties","SubscriberKey")  

/* Added this line below */
AddObjectArrayItem(@rr,"Properties","Status")
/* Added this line above */

SET @sfp = CreateObject("SimpleFilterPart")  
SetObjectProperty(@sfp, "Property", "SubscriberKey")  
SetObjectProperty(@sfp, "SimpleOperator", "equals")  
AddObjectArrayItem(@sfp, "Value", @email)    
SetObjectProperty(@rr, "Filter", @sfp)  
SET @sub = InvokeRetrieve(@rr)

SET @row = Row(@sub,1)   
SET @name = Field(@row ,"EmailAddress") 
SET @status = Field(@row, "Status")
]%%

%%=V(@name)=%%<br/>
%%=V(@status)=%%<br/>
1

It depends on the unsubscribe settings in the business unit and how you're logging the UnsubEvent. In a 2.0 account, every subscriber exists in All Subscribers at the parent level. They're shared across all business units. There's a hidden data view that keeps track of the subscribers status per business unit.

Logging an UnsubEvent ensures the hidden data view is updated properly -- otherwise they'll be unsubscribed at the parent level.

4
  • This is in a Developer Account, so 1 BU. I've set Master Unsubscribe with just setting the Subscriber Status to 'Unsubscribed' this sets all Lists/Groups to 'Unsubscribed'. I've also used the LogUnsubEvent and get the same results. Everything seems to be functioning properly except the fact that when I retrieve the Subscriber Status (the List 'All Subscribers' says Unsubscribed through the API and in SFMC) the Status comes back as 'Active'??? Oct 20, 2015 at 21:35
  • I wouldn't be surprised if the Developer Accounts handle unsubs differently. SF pulled the plug on the Dev accounts pretty darn quick after Connections 2014. Oct 20, 2015 at 21:47
  • Maybe...I just don't get why the above RetrieveRequest of Subscriber Status would show 'Active' when everywhere else it shows as 'Unsubscribed'. If I do a RetrieveRequest on the ListSubscriber object for the same subscriber the All Subscriber list shows correctly??? I'll have to give this a go in a Production Account. Oct 20, 2015 at 21:56
  • I added an image above that shows the Subscriber Status of Active while All Subscribers shows Held??? Oct 20, 2015 at 22:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .