Issue setting an Action output of type Object

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2024 10:46 AM
Greetings,
In order to make an API call I need to create an Object of Objects to pass into the API call. Ex, it would look something like this where I am creating an accessProfiles object that consists of 2 access profiles.
"accessProfiles": [
{
"id": "ff808081751e6e129f1518161919ecca",
"type": "ACCESS_PROFILE",
"name": "Access Profile 2567"
},
{
"id": "ff808081751e6e129f1518161919eccb",
"type": "ACCESS_PROFILE",
"name": "Access Profile 2568"
}
]
The input to my action is nothing more than 1 or more of these access profiles which in exist in our instance in a custom table.
Then I have the following script step that is creating this array of access profile objects. I am then attempting to stuff this array into an output object.
I added a couple of logging statements to view the array and to also view the final object. Those look as expected.
Profiles Object: {"accessProfiles":[{"id":"2c9180857b37101c017b3b824d29135b","name":"SN.01 Test AD Group - auto provisioning (NA Domain)","type":"ACCESS_PROFILE"},{"id":"c027b0bd20dc4606a4d2b5eef388f36a","name":"OneSource (Admin & API Admin) - Identity and Access Administrator Role Sandbox","type":"ACCESS_PROFILE"}]}
Outputs Object: {"accessProfiles":[{"id":"2c9180857b37101c017b3b824d29135b","name":"SN.01 Test AD Group - auto provisioning (NA Domain)","type":"ACCESS_PROFILE"},{"id":"c027b0bd20dc4606a4d2b5eef388f36a","name":"OneSource (Admin & API Admin) - Identity and Access Administrator Role Sandbox","type":"ACCESS_PROFILE"}]}
The problem is that when I look at the flow result the output variable, access_object, is empty.
What I am doing wrong when trying to assign this Object of objects to the output?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2024 04:56 PM
This would happen if you didn't define your child output items correctly. Make sure you use the "Add child item" button to define your output structure, the "name" column is the important thing and is what should match with your output object:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2025 01:34 PM
Is there any way to just pass the object itself without having to elaborate its inner structure in this way? I have several Custom Action use cases where the structure of an object-type Output Variable is unknown until runtime, so hard-coding the structure like this won't work. I can work around this by converting the object to a string, but that adds a lot of extra unnecessary, duplicative processing and steps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2025 01:45 PM
Probably the output are not mapped in the Output section highlighted below:
If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2025 02:40 PM
Hi Medi,
The Script Step Output Values are mapped to Action Output Values via data pills. It seems the problem is more fundamental -- Custom Action Input and Output Variables are always converted to string type values, no matter how they're originally set, as per this article (also, see image from the article below):