I am trying to add AMPscript to the inbox message (MobilePush).
The AMPscript added to the Inbox subject line ( default SFMC field inside inbox) or other custom fields like body,cta etc. does not work at all.
This is the below ampscript code I am using and there are no errors -
%%[ SET @business_unit = AttributeValue("business_unit") IF (@business_unit == "US") THEN Set @ans= "its US TEST" ELSEIF @business_unit == "IT" THEN Set @ans= "its IT TEST" ENDIF ]%% %%=v(@ans)=%% Please can someone guide me how to troubleshoot this problem so that the AMPscript works in inbox message?
Note: I have tested this code in email studio against the send Data extension used for sending inbox messages and the code works perfectly.
I also tried using a lookup using the BU
%%[ set @bu = AttributeValue("business_unit"); set @msg = Lookup("messagesDEX","message","BU", @bu); ]%% %%=v(@msg)=%% Even this did not work.
I also tried using a very simple code, by directly storing the message field in Send DE, still no success.
%%[ set @msg = AttributeValue("message") ]%% %%=v(@msg)=%%
business_unitusing_subscriberKey, where_subscriberKeymatches the column in your sending DE that uniquely identifies the subscriber.