Handlebar expression evalution is causing issue

I have integration from Salesforce to Salesforce, we have created a lookup for account I have used the below handlerbar if account exists it will return Id or else the response will be empty.
{{#if data.0.Id}}{{#compare data.0.Id '!=' null}}{{data.0.Id}}{{else}}null{{/compare}}{{else}}null{{/if}}

the handlebar evalutes to “null”(string null value)

In the next step, I have to do check whether the the value is “null” or not then don’t do anything, which I think should be scenario if I could use discard if empty.

Hi Lakhan,

I think you can just use no data in place of the ‘null’ like this;

{{#if data.0.Id}}{{#compare data.0.Id '!=' null}}{{data.0.Id}}{{else}}{{/compare}}{{else}}{{/if}}

I could be wrong though!

Hey Matthew Lacey,

Bingo! I have has the same thought process but it did not work, the attribute itself did not pop up in the data.

1 Like