Salesforce to Netsuited failing due to $0

We're using Celigo to map products from Salesforce into Netsuite to created Sales Orders. The problem is when a customer churns a product, we need to enter into Salesforce as a $0 product to be able to calculate the churned dollar amounts for our FP&A team.

However, Celigo keeps erroring out with these products because they don't have an amount entered, and the way the mapping is set up, it's requiring a value. I've tried a multitude of ChatGPT searches and Celigo Community searches, but I'm coming up empty handed. Do you know how I can fix this?

Hello Ali,

For your use case, you can apply Handlebar mapping or define a default value when the returned amount is empty or zero. Here’s an example:

{{#compare amount "==" ""}}0{{else}}{{amount}}{{/compare}}

In this expression, if the amount field is empty, it will default to 0. Otherwise, it will display the original value.

If this doesn’t address your issue, feel free to create a ticket, and we’ll be happy to assist you further.

1 Like

Thanks, Bernie.

How would I use those handlebars, if this is what’s already in the mapping?

{{divide OpportunityLineItems[*].FMV_Sales_Price__c OpportunityLineItems[*].Dealhub_Quantity__c}}

Hi Ali,

I see you’re using divide in your handlebar expression. To provide more targeted recommendations, we may need to take a closer look at the data.

I believe there’s already a ticket open for this issue, so I suggest working closely with the assigned representative to move things forward.

This is the only ticket I have open. I don’t know what you’re talking about.

Hi @Ali_Andrew :slightly_smiling_face:

Bernie was referring to the support ticket you submitted yesterday. One of our reps is on it and just waiting for your reply.

You can check your email or head over to the Requests page in the Celigo Help Center to view and respond to the ticket.

Let me know if you need help finding it!

got it - i think this would be fastest and easiest if we can hop on a call. thanks.

Hi Ali,

Circling back to this discussion, which relates to ticket 254989.

Flow: Salesforce Opportunity to NetSuite Sales Order (Add/Update)
Error: Failed to save record because "Please enter a value for amount."

Current Item Mapping for Rate:

{{divide OpportunityLineItems[*].FMV_Sales_Price__c OpportunityLineItems[].Dealhub_Quantity__c}}

Findings:

  • Because the divide helper in Handlebar performs direct division, a 0 value in Dealhub_Quantity__c results in undefined or NaN (Not a Number), which triggers the error
  • To address this, you can use conditional logic (#compare or #if) to handle zero values

Options provided:

Option 1: Using #compare

{{#compare OpportunityLineItems[*].Dealhub_Quantity__c "==" 0 }}0{{else}}{{divide OpportunityLineItems[*].FMV_Sales_Price__c OpportunityLineItems[*].Dealhub_Quantity__c}}{{/compare}}

Option 2: Using #if

{{#if OpportunityLineItems[*].Dealhub_Quantity__c}}{{divide OpportunityLineItems[*].FMV_Sales_Price__c OpportunityLineItems[*].Dealhub_Quantity__c}}{{else}}0{{/if}}

As you confirmed in the ticket, Option 2 resolved the issue.

The ticket has also been closed.

Related Article:

3 Likes