- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2023 03:37 PM
Hello everyone,
I have created a custom action with query group members and return array.string(email of users) as below, it's testing successfully.
Then, i used "Test Get Group Members" in Flow with script as below, and the flow run Internal Server Error
Please someone help me ! Thank you so much
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2023 05:45 PM - edited 12-24-2023 05:48 PM
@Dinh Nguyen : Please refer the below HI article that describes the steps for this issue. Check if this helps.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0831029
Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2025 07:48 AM
You should create a Flow variable to hold your array and set it using the Set Flow Variables Flow Logic.
the fd_data "object" is not an object and it is used to match a pattern that is replaced before execution with the real object. E.g., fd_data.flow_var.x is replaced with inputs.flow_var_x. You can prove it by using
gs.log('fd_data.flow_var.x=' + fd_data.flow_var.x , 'my Flow');//this logs inputs.flow_var_x=
FYI you can't use inputs.flow_var_x since it doesn't exist until you use fd_data.flow_var.x, so just use fd_data.flow_var.x
Also, you don't need to name the IIFE or pass the inputs and outputs global objects since they are global and available inside the IIFE. The IIFE can be simply
(function () {
} ) ();
with your code inside.
Don't try to add undefined variables to the outputs since the pattern matching Logic won't recognize it for replacement.
I also suggest you use String(gr.user.email) since the toString() function returns a Java String and could throw an exception if gr.user.email is null.
Always check the values before using them so your code should be
if(gr.user.email) ar.push(String(gr.user.email) );
Better yet you can put user.email!= (or user.emailISNOTEMPTY) in your query as well as checking the values before using them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2023 05:45 PM - edited 12-24-2023 05:48 PM
@Dinh Nguyen : Please refer the below HI article that describes the steps for this issue. Check if this helps.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0831029
Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2025 07:48 AM
You should create a Flow variable to hold your array and set it using the Set Flow Variables Flow Logic.
the fd_data "object" is not an object and it is used to match a pattern that is replaced before execution with the real object. E.g., fd_data.flow_var.x is replaced with inputs.flow_var_x. You can prove it by using
gs.log('fd_data.flow_var.x=' + fd_data.flow_var.x , 'my Flow');//this logs inputs.flow_var_x=
FYI you can't use inputs.flow_var_x since it doesn't exist until you use fd_data.flow_var.x, so just use fd_data.flow_var.x
Also, you don't need to name the IIFE or pass the inputs and outputs global objects since they are global and available inside the IIFE. The IIFE can be simply
(function () {
} ) ();
with your code inside.
Don't try to add undefined variables to the outputs since the pattern matching Logic won't recognize it for replacement.
I also suggest you use String(gr.user.email) since the toString() function returns a Java String and could throw an exception if gr.user.email is null.
Always check the values before using them so your code should be
if(gr.user.email) ar.push(String(gr.user.email) );
Better yet you can put user.email!= (or user.emailISNOTEMPTY) in your query as well as checking the values before using them.