- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2025 08:44 AM - edited 05-11-2025 08:58 AM
1. My action script is below
(function execute(inputs, outputs) {
var response = JSON.parse(inputs.response);
outputs.responsedata.code = response.errorCode;
outputs.responsedata.message = response.message;
})(inputs, outputs);
So the output of action script is an object
Output of action, it's an object type
I want to get API error code and message in subflow as this - if loop to check if code is 1 or 0 but the subflow is not working.
Sub flow if condition on Action-REST Step-Code data pill - no match found
Why the object is not showing values under it
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2025 09:51 AM
Hello @Snehal13 ,
Just defining the Object as an Output Variable is not enough.
You also need to define its properties that you are populating in the script. You do that by clicking the small (+) icon on the ResponseData output variable:
You will also have to add one more line to the script:
(function execute(inputs, outputs) {
var response = JSON.parse(inputs.response);
outputs.responsedata = {}; // add this line
outputs.responsedata.code = response.errorCode;
outputs.responsedata.message = response.message;
})(inputs, outputs);
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2025 11:15 AM
Hello @Snehal13 ,
Ok, and what are the results when you use the built-in Test feature to test the Action/Flow?
For example, I have created an Action like yours, but using a simplified script step:
(function execute(inputs, outputs) {
outputs.responsedata = {};
outputs.responsedata.code = "100";
outputs.responsedata.message = "my message";
})(inputs, outputs);
When testing the Action the results are as expected, both for the script step and the overall action output:
If you can test with a similar simplified script and get the expected outputs then it means your Action is configured correctly, but there must be some issue in your actual script or the input, probably something very subtle.
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2025 11:21 AM
Thanks for all your help. I will debug from here. Something minor missing. everything is fine- action output, API response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2025 10:10 AM
This is a duplicate of
Why open another question when you already had one going?