Error: "fd_data" is not defined.,Detail: "fd_data" is not defined.

SM123
Tera Expert

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!

10 REPLIES 10

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. 

Mihir Mohanta
Kilo Sage

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

 

Hi @Mihir Mohanta ,

I referred it. but it did not help. 

Ankur Bawiskar
Tera Patron
Tera Patron

@SM123 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@SM123 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader