1

Recently had a requirement to trigger a send from a custom object and am receiving an error when trying to test the Email with some AMPscript send a few attributes from the custom object from which we are triggering the send.

Error:

Invalid row (parameter 1) passed to Field function. Row is null or empty. Function: FIELD(@EventLogsRow,'Contact_First_Name__c')

My code:

%%[
Set @mySObject = SObject
Set @myRecordId = RecordId
Set @EventLogsRow = Row(@Event_Logs, 1)
Set @ContactFirstName = FIELD(@EventLogsRow,'Contact_First_Name__c')
Set @LatestSSD = FIELD(@EventLogsRow,'Latest_SSD__c')
Set @TestEventMessage = RetrieveSalesforceObjects(SObject,'Contact_First_Name__c,Latest_SSD__c','Id','=',RecordId)
]%%
  • 2
    you might be missing a lookuprows call to retrieve the EventsLog table. You also havnt declared EventsLog – Samuel Dare Feb 21 '18 at 16:46
  • agree with Data_Kid. @Event_Logs is undefined in the code snippet provided. – David Devoy Feb 21 '18 at 20:32
  • @Data_Kid, I have a question on how triggered sends fundamentally work in conjunction with the referenced data extension in the Trig send definition... Since SObject and RecordId are both attributes of the DE what happens when there is no records populated there. My assumption was the data extension is empty until it's populated with data from the triggered send, then the AMPscript is to populate data from that record in the DE which had just been created. The reason I ask is because without a test record populated in my TS-DE I am unable to get the send to work. Please help. – Dom Mar 12 '18 at 17:56
0

Thanks for the responses guys!

I updated my AMPscript to the following and it's working as required now:

%%[
Set @myCustomObject = SObject
Set @myRecordId = RecordId
Set @EventLog = RetrieveSalesforceObjects(@myCustomObject,'Contact_First_Name__c,Latest_SSD__c','Id','=',@myRecordId)
Set @EventLogsRow = Row(@EventLog, 1)
Set @ContactFirstName = FIELD(@EventLogsRow,'Contact_First_Name__c')
Set @LatestSSD = FIELD(@EventLogsRow,'Latest_SSD__c')
]%%

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.