Mismatching Variables in Postgres

hello, I have a simple workflow that updates postgres row from a returned payload with set variables, issue is some workflows that are triggered return differently organized variables and postgres mistakes it for wrong one when adding. For example. here is what i setup the workflow to do and variables


  0 {2}
    ChargeType: MarketplaceFacilitatorTax-Shipping
    ChargeAmount {2}
      CurrencyCode: USD
      CurrencyAmount: 0
  1 {2}
    ChargeType: MarketplaceFacilitatorTax-Principal
    ChargeAmount {2}
      CurrencyCode: USD
      CurrencyAmount: 0


Now when I receive a payload with differently organized variables or variable might be missing like this…

as you can see it is ‘0’ and in the workflow i setup ‘0’ is for “marketplace_facilitator_tax_shipping” but because it is missing it mistakes it and adds it as that instead of what is returned from the payload which should be “MarketplaceFacilitatorTax-Principal”

Postgres mistakes this and adds it under the “marketplace_facilitator_tax_shipping” column in the database

Any way to solve this?

Still trying to find a solution, I’ve got the paid plan after seeing that everything went well with my workflows but this is the only issue I’m stuck on before completing everything. Any help? Willing to book consultation with anyone.

Hi @arcminecrafter

First off, welcome to the Pipedream community. Happy to have you!

You can book a consultation with a Pipedream Partner here: Connect with a Pipedream Partner

But just as guidance, I recommend you learn the basics of Javascript Arrays to help understand the meaning of that number, which is called the index.

This is the book I used myself to get started in Javascript programming, I highly recommend reading it to get started:

https://eloquentjavascript.net/