I want to retrieve informations in a Data Extension synchronised with an event (object) on a preprod environnement to make custom fields on an email :enter image description here and my targets for the email are like this :

enter image description here

I want to retrieve the sessions that have an eventName equals to WomensForum So I have this code with a lookupOrderRows

VAR @idevent, @sessions, @nbsessions, 

SET @eventName = attributevalue("MC_EventName")
SET @nbrow = 50
SET @sessions = lookupOrderedRows("EventApi__Schedule_Item__c",50,"EventApi__Start_Date__c",@eventName, "WOMEN'S FORUM SINGAPORE 2018","EventApi__Is_Active__c", "TRUE", "FormatType__c", "Workshop")
SET @nbsessions = rowcount(@sessions)

But I get this error :

The Data Extension name for a LookupOrderedRows function call is invalid. A Data Extension of this name does not exist. Data Extension Name: EventApi__Schedule_Item__c Function Call: lookupOrderedRows("EventApi__Schedule_Item__c",50,"EventApi__Start_Date__c",@eventName, "WOMEN'S FORUM SINGAPORE 2018","EventApi__Is_Active__c", "TRUE", "FormatType__c", "Workshop") Parameter Name: DataExtensionName Parameter Ordinal: 1

which I don't understand because if I understood correctly, my dataExtension should exist thanks to the API name. If you have any thought on this, don't hesitate. Thanks !

EDIT: example fields

enter image description here

  • 1
    Are you running this from a child business unit or from the parent business unit? Try looking up ent.EventApi__schedule_item__c also, if I understand your screenshot correctly, the name of your data extension is called Session (?) So try looking up on that – Gravitai Jul 23 '18 at 22:46
  • I'm on the good Business Unit but I don't have a real Data Extension in marketing cloud named "Session" because it is a custom object from lightning with many custom fields that I want to use in my email. I added a sample of fields in the image. Maybe I didn't understand how ampScript works but we should be able to use those custom object, don't we ? – Pierre-Adrien Delisle Jul 24 '18 at 7:49

I found that I had to use the RetrieveSalesforceObject function instead of lookup, to call custom objects and it works perfectly.

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.