Error: "fd_data" is not defined.,Detail: "fd_data" is not defined.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2024 10:04 AM
Hello All,
I have a variale in my flow called "count" i'm trying to increment the count from previous actions using below script but i'm getting this error. but this was working fine yesterday.
Error: "fd_data" is not defined.,Detail: "fd_data" is not defined.
var count = 0;
if (fd_data._9__get_group_members.answer == true) { count++; }
if (fd_data._11__get_group_members.answer == true) { count++;}
if (fd_data._13__get_group_members.answer == true) { count++; }
if (fd_data._15__get_group_members.answer == true) { count++; }
if (fd_data._17__get_group_members.answer == true) { count++; }
if (fd_data._19__get_group_members.answer == true) { count++; }
if (fd_data._21__get_group_members.answer == true) { count++; }
if (fd_data._23__get_group_members.answer == true) { count++; }
if (fd_data._25__get_group_members.answer == true) { count++; }
if (fd_data._27__get_group_members.answer == true) { count++; }
return count;
Thank You!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2024 10:41 AM
Can you tell what the difference is between the times it works and the times it doesn't? If it's that this particular step doesn't get executed when it does work, then you know this step is the issue.
You may try simplifying it to just using one of the "if" statements to see if you have the same issue. I assume you are selecting these from the suggested drop downs when you are creating the code and not just typing them in. If so, then you know your step numbers are correct.
If all else fails, delete this step and re-add it. Sometimes things get messed up and re-creating it fixes it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2024 10:17 AM
Hi,
Please try to use the fd_data as per mentioned in the below KB article and see if it helps.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0831029
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2024 10:35 AM
Hi @Mihir Mohanta ,
I referred it. but it did not help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2024 07:05 PM
you are saying it works sometimes and sometimes it doesn't
where have you written that script? is it within that custom action?
Why not pass input to that custom action rather than using fd_data?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2024 08:57 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader