[SalesForce] Subscriber object Status ‘Active’ and Unsubscribed from All Subscribers

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

Best Answer

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/>
Related Topic