I wrote the following script to pull in a Sales reps name.
%%[ var @Territory, @mdmidKey, @SalesRep set @mdmidKey = [mdmid] set @Territory = Lookup("BR_Call","Territory_vod__c","External_Id_vod__c",@mdmidKey) set @SalesRep = Lookup("TerritoryVOD","SalesRep","Territory__vod__c",@Territory) IF Empty(@SalesRep) THEN SET @SalesRep = "Company X" ENDIF ]%% %%=v(@SalesRep)=%%
The issue I am running into is that this work perfectly fine when I have it in an email and I am previewing my subscribers. When I put the script into my Sender Name for my dynamic sender profile, I get an error message:
"TEST SalesRep Dynamic Sender External Key: xxxx Invalid Sender Profile state. ClientID: xxxxxxx SenderProfileID: 80fb3486-712a-fb11-a2f2-1422eg948a8d Sender Profile Name: TEST SalesRep Dynamic Sender CustomerKey: xxxx The FromName AMPScript contains the following errorsScript SET Statement Invalid - "set @mdmidKey = [mdmid]""
It seems it does not like my
set @mdmidKey = [mdmid] line. Is there a different way to have this formatted to work for a dynamic sender profile for the sender name?