- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
i wrote the script that selected user has the admin role the the flow should be continue. here when tesing i am getting this error message. "Error: Cannot read property "variables" from null,Detail: Cannot read property "variables" from null"
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
Hello @saikumarkak
When I tried with below code in script part where you check and set value of flow variable, I also did same, and it worked for me. Have a look and give try.
//fd_data.trigger.request_item.variables.<variable name>.sys_id;
var a = fd_data.trigger.request_item.variables.affected_user.sys_id;
//checking by passing user sys_id and if it has role admin
var b = gs.getUser().getUserByID(a).hasRole('admin');
//return of value is it true or false.
return b;
If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.
Thanks & Regards
Viraj Hudlikar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
Hello @saikumarkak
When I tried with below code in script part where you check and set value of flow variable, I also did same, and it worked for me. Have a look and give try.
//fd_data.trigger.request_item.variables.<variable name>.sys_id;
var a = fd_data.trigger.request_item.variables.affected_user.sys_id;
//checking by passing user sys_id and if it has role admin
var b = gs.getUser().getUserByID(a).hasRole('admin');
//return of value is it true or false.
return b;
If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.
Thanks & Regards
Viraj Hudlikar.