Using HTTP Request response body to populate Select List in Interactive Form

I have a need for a process that works like this:

  1. Select an identity using an Interactive Form
  2. Select a correlated account and return the ID
  3. Make an API call to another system to pull the user data for that ID
  4. GET a list of things from #3, let’s call them A, B, and C
  5. Select A, B, or C from a Select List on an Interactive Form
  6. POST another HTTP Request using the selected option from #5

I’ve been trying to read up about Form Inputs and Interactive Forms, but I’m not finding good examples of something like this where the Select List is populated by the response from an HTTP Request. Is something like this possible, and would anyone be able to provide some guidance on how to set up the flow from #4 to #5 above? Thanks!

It’s not like something in ServiceNow where you can do an onChange action to go fetch some data. Forms are fairly static in that they have inputs fed to them, but can’t generate new values for fields once they’re rendered.

Similar discussion happened here

I think my issue may be related to turning the array $.httpRequest.body into a new array defined on the form input for the Select Field. In my testing, I’m getting this error:

unable to find value to use for value field in item at index 0 with jsonpath expression ‘$.selectListArray’

It’s almost like it’s not parsing the array returned by the HTTP Request into multiple key/value pairs that it can put into the Select List.

Here’s what my workflow looks like:

Hi @sbakeraci

I think I’ve experienced something similar with the inputs. It’s very picky about what kind of objects it will allow into the array.

I think you’re trying to pass an array of strings? If so, I haven’t found a way to get that into the form inputs. If you could show an example of what one of your inputs look like printed out, I think that may help.

This thread I previously created may help as well: Form Inputs - Array Value & Array label - #2 by kyle_knox