Adding table reference through API Post

Options
Hi,

I am trying to add the order ID to a payment entry, two separate tables with a table reference in the payment table referencing the order table via the ID.

I have queried the order table and found the correct order, as per screenshot.[Screenshot 2022-04-22 at 16.43.08.png]I have then created a new variable with the order_id.id to be able to use this throughout the function stack.[Screenshot 2022-04-22 at 16.47.45.png]but when i add it to the record in step 4, there is no value
[Screenshot 2022-04-22 at 16.43.19.png][Screenshot 2022-04-22 at 16.43.08.png][Screenshot 2022-04-22 at 16.46.59.png]
There is probably an easy solution for this, but I have not been able to find any in the forum.

Thanks for the help in advance!
Per

Comments

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
    Your order ID is in an array (list)
    [CleanShot 2022-04-22 at 15.22.06.png]
    Anytime you see those flat brackets [] it signifies an array data type. Even if it's a list of 1, it is still a list. You would need to extract your value from the list. You could do this with array filters like pop or shift. 

    You should be mindful however if you will be expecting a list of more than 1 order ID and which order ID you actually want - or if you want the whole list. 
  • Per Thiessen
    Options
    Perfect! There will only be one order linked to each payment, so it works when I filter on First in the variable.

    Thanks for the help Michael!