- 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 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 10:26 AM
Ok, Now I can see the data pill inside the object in subflow but still cant have the condition met. looks like the value from output of action is still empty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2025 10:54 AM
Your question was only about making the properties of your output object available as data pills. So you should mark it as answered.
If some value is empty you'll have to debug your script. Have you verified that the inputs.response property contains the expected data?
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2025 11:01 AM
I have accepted your solution from prev comment. Thanks.
It does. I do get values in the below logs