Script is returning null in flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2024 12:18 AM
Hi all,
I created a flow as shown in below image .
In create catalog task, I tried to set the field assignment group through scripting to get the group value from decision table but it was returning null for below code::
I tried of getting same group name through decision table in fix script . It was returning the group sys_id.
Please Can anyone suggest what I was missing in the code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2024 03:04 AM
Already It was already pre configured flow so they need the changes. So I used the script instead of "Get decision step".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2024 02:04 PM
But still I would recommend to add a "Get Decision" step before that one, and to use the output in this one instead of scripting against an API. Think about maintainability and future compatibility.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2024 02:59 PM - edited 03-22-2024 03:01 PM
Maybe variable names don't actually match what is in the script?
I would introduce Flow Variables into the equation, one for company and one for country.
I would set those variable with help of a "Set Flow Variables" flow logic.
Than I would use those variables (vs. actions) in the script.
It makes all of it more robust, because renaming actions would not brake references to those actions in scripts and it would allow you to view the values used and forwarded to the API when debugging the flow.
I mean assignment being null means that no decision could be taken - which might be because unexpected data is forwarded to the input object.