Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Flow Designer with Data Source question

Sunny45
Kilo Guru

Hello,

I have a need to run two REST API call. One for getting the Token and second one using that token for getting the Data.

While creating Action record from Data source, I am not able to see adding (+ sign ) in Flow Designer to add second REST API call. 

One option I am seeing as creating Input variable via script  and store the token in variable prior to making second REST call, but not sure how to. 

Can you please help how can I achieve this?

 

1 ACCEPTED SOLUTION

Thanks for the image updates.

Create a new flow action with your rest step that retrieves the token.  The token value will be an output from the action.  Save/Publish the action, then copy the code snippet for that action:

find_real_file.png

You can then use that code snippet in the script step of the Data Source Request:

find_real_file.png

--> To help others, please mark this as Correct or Helpful if this response has been of any use. <--

View solution in original post

4 REPLIES 4

Jon23
Mega Sage

Your images are not displaying for me, however, what you are describing sounds correct> first API call to get token > pass token to second api call.

Hi Jwalton,

Sorry, I have uploaded the images now. Please take a look.

Thanks,

 

Thanks for the image updates.

Create a new flow action with your rest step that retrieves the token.  The token value will be an output from the action.  Save/Publish the action, then copy the code snippet for that action:

find_real_file.png

You can then use that code snippet in the script step of the Data Source Request:

find_real_file.png

--> To help others, please mark this as Correct or Helpful if this response has been of any use. <--

Thanks Jwalton.