How do I add function result to response variable as key-value pair?

Options

I have figured out the function stack to loop through a list of records and perform simple addition of fields within each record. The last step in the loop is "Array: Add To End" which adds the variable that is the sum of field values to the end of the loop item.

When looking at the output, it's just the value, eg. 5. How would I instead add a key to this value, eg. Total_Units: 5?

Answers

  • Lachlan
    Lachlan Administrator

    ADMIN

    Options

    Hi there, nice work getting through the loops process!

    You are able to use the set filter on an object to create key-value pairs.

    You can add a new variable to your function stack and configure it like this:


    The output will be:

    {Total_Units: "insert your result variable here"}


  • EricP
    EricP Member
    Options

    Thank you, that definitely leads me in the right direction.