flow designer - custom actions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 12:50 AM
hello Developers,
I am getting this below response from one of the API call which I am doing through the flow action.
Below is the response body..
{"result":[{"sys_id":"a1861bdcd7011200f2d224837e610328","sys_updated_by":"admin","sys_created_on":"2023-10-05 16:58:55","sys_mod_count":"1","sys_updated_on":"2023-10-05 16:58:55","sys_tags":"","user":"506c0f9cd7011200f2d224837e61030f","sys_created_by":"admin","group":"0a52d3dcd7011200f2d224837e6103f2"}]}
Ask is I want to fecth the sys_id from the response body and pass this as an input to other custom flow action.
Please help me how I can fetch the sys_id from the above response so that I can pass this an input to other flow action..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 03:24 AM
I am having 2 custom actions
1). Get member from group - having rest step and GET method to fetch the records.
2). Remove member from group - having delete method..
my first action ( get member) is able to fetch the record through an api and below is the response body for it. I am storing this response in one of the output variable I have created in the same action( get member). I want to fetch the sys_id out of it and need to pass this sys_id as an input to other action ( remove member from action ) to make a another api call which have delete method.
I am calling these both actions from a common flow.
{
"result": [
{
"sys_id": "a1861bdcd7011200f2d224837e610328",
"sys_updated_by": "admin",
"sys_created_on": "2023-10-05 16:58:55",
"sys_mod_count": "1",
"sys_updated_on": "2023-10-05 16:58:55",
"sys_tags": "",
"user": "506c0f9cd7011200f2d224837e61030f",
"sys_created_by": "admin",
"group": "0a52d3dcd7011200f2d224837e6103f2"
}
]
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 04:34 AM
Please have a look on the below example :
You can make use of this script action just after your REST Step in Get Member from Group action. Map the input variable jsonString with the output variable of your REST STEP then make use of the script which I shared earlier to parse the JSON and get the sysID. We will store this sys_id in the Script Step action.
Finally, set the output variable sysid as shown below :
When you will test it, you will get the sys_id in your output variable which you can pass to your other action in the flow.
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.