- 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
Does the flow run as system user or as user initiating the flow?
Next to that: you are getting the variable from the trigger record, while you have the requested for in your first action (get variables). Why don't you get it from there?
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
@Mark Manders ,
Thanks for the response,
flow run as system admin.
you are getting the variable from the trigger record, while you have the requested for in your first action (get variables). Why don't you get it from there?
you mean can i use getVariables to get the variable value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
@Mark Manders ,
can you explain little bit more to understand.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark