Handlebar help for newbie

I am new to Celigo and have only been using it for about a week. I need to map a field but also provide a default value if the field is null from the source.

Here is the overall logic:
The source field is called : Service_Location__r.Forerunner_Asset_ID__c
The target field is called : Asset ID(Internal)

Here is my logic:
If (Service_Location__r.Forerunner_Asset_ID__c == null)
map "43978" to Asset ID(Internal)
else
map Service_Location__r.Forerunner_Asset_ID__c to Asset ID(Internal)
end

I have tried but have not been successful building a handlebar to do this.

Any help is appreciated.

Assuming this is mapping to NetSuite or Salesforce:

{{#if Service_Location__r.Forerunner_Asset_ID__c}}{{Service_Location__r.Forerunner_Asset_ID__c}}{{else}}43978{{/if}}

If mapping to something else:

{{#if record.Service_Location__r.Forerunner_Asset_ID__c}}{{record.Service_Location__r.Forerunner_Asset_ID__c}}{{else}}43978{{/if}}

I think that worked. Thanks. I was making it much harder than necessary.

1 Like