Trying to divide fields in a nested structure but handlebar expression is not working

Answered

Comments

5 comments

  • Tom Santiago Principal Technical Writer Community moderator
    Engaged
    Top Contributor
    Celigo University Level 4: Legendary

    Hi Chidi Okwudire,

    I think the problem is caused by your use of wildcards (*) in the handlebars expression. integrator.io doesn't iterate through all of the amounts and quantities in the array when attempting to calculate the expression. You would have to use a preMap hook to perform the operation.

    Tom

    0
  • Chidi Okwudire
    Engaged
    Celigo University Level 1: Skilled

    Hi Tom Santiago,

    Thanks for the clarification!

    0
  • United Scope

    Hi Chidi Okwudire!

    I am trying to do this same thing right now in the WalMart > NetSuite Integration App because the item rates are coming in incorrectly for multi-quantity orders.

    I am unfamiliar with pre/post map hooks, but it also does not look like the integration app will let me add any?

    How did you end up resolving this issue?

    I am considering trying to override the total amount and just ignore the rate, but if this works it would mean incorrect item rates in NetSuite. Not the worst thing but I would of course prefer clean data.

     

    0
  • United Scope

    actually this might have worked for me in the mapping - at least in the preview output.

    {{divide orderLines.orderLine[*].itemPrice orderLines.orderLine[*].orderLineQuantity.amount}}

    0
  • Chidi Okwudire
    Engaged
    Celigo University Level 1: Skilled

    Hi United Scope,

    I think we moved away from this approach completely based on Tom's comment or we implemented the hook.

    The latter might nto be an option for you as you rightly observed due to edit restrictions on apps.

    I hope you find a way.

    0

Please sign in to leave a comment.