Multi-select field to JSON

Options
Arthur_319926
Arthur_319926 Posts: 10
edited October 2020 in Questions

I need to take the individual selections of a multi-select field and use them to look up information in a reference table. These referenced look ups need to be concatenated into a string so I can use it in the body on an API request. What I really need is a "For Each" loop, but Catalytic doesn't have that option.

Example: In a multi-select field I have chosen Apples, and Orange, I need to look these up in a variety reference table. Passing Apples into the reference table returns Gala, Orange returns Cutie. I need to format the Gala and Cutie response into this JSON format:

{
"valueIds": [ "Gala", "Cutie" ]
}

I have a good idea how to do this if it was a single select field, but not with a multi-select.

Any thoughts?

Answers

  • Sarah_154708
    Sarah_154708 Posts: 13 admin
    Options

    Hi @Arthur_319926 ,

    Thank you for your question! I have attached a workflow that should help you here.

    This workflow gets the length of the Fruit array from a multiple choice field and then loops for each item adding it to a final string. This string is then place within the JSON format and can be used in your API request.

    Let me know if you have any questions. Thank you!