The CreatorCon Call for Content is officially open! Get started here.

How to systematically add query parameters from JSON input to REST Message Action Step in Flow Designer?

Joshua Morriset
Giga Contributor

We are looking into a custom Jenkins spoke due to a limitation with the official one (see https://community.servicenow.com/community?id=community_question&sys_id=9f700267dbac08d014d6fb243996190d). The issue is that I need to be able to allow users to add query parameters to the REST request for a parameterized Jenkins Build. I don't know how many parameters, or what the 'keys' or 'values' are in the key value pair.

I would like to have an action input that is of the type JSON that I can parse through and add each key value pair to the query parameters to the REST Message in the next step. I don't know an appropriate way, if any, to do this. How do you add an unknown length of JSON key value pairs to a REST Message action step's query parameters?

find_real_file.png


Best Regards,
Joshua

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Having a JSON input is counter intuitive to how you want to design your actions.

The idea is that people without coding skills can simply pick data from a record or hard code it in to a field (or two or three) and use that action as a 'black box' to get a result and possibly use it further in the flow.

If someone is creating a flow, consider using something like a trigger record or lookup record with a name/value field pair (which stores JSON behind the scenes) and let them configure the query parameters in that record to your action's REST step.

View solution in original post

2 REPLIES 2

Chuck Tomasi
Tera Patron

Having a JSON input is counter intuitive to how you want to design your actions.

The idea is that people without coding skills can simply pick data from a record or hard code it in to a field (or two or three) and use that action as a 'black box' to get a result and possibly use it further in the flow.

If someone is creating a flow, consider using something like a trigger record or lookup record with a name/value field pair (which stores JSON behind the scenes) and let them configure the query parameters in that record to your action's REST step.

Chuck Tomasi
Tera Patron

FYI - A response to this post was featured on the Community Live Stream video. I invite you to watch the episode.

Video: Community Live Stream - 2019-10-23 - Developer Community - ServiceNow Community