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'.
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???