- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2023 12:42 AM
Hi All, In Flow Designer, for order task i want to auto populate assign to field is current logged in user. any one help me on that.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2023 05:36 AM
Please discuss with your customer what do they mean by logged in user
are they referring to the user who raised the RITM?
if yes then do this
return fd_data.trigger.request_item.request.requested_for;
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
‎06-26-2023 11:54 PM
Yes Ankur I discussed with customer, requirement is
For product order task is created assigned to field is auto populate current logged in user
I used below code
return gs.getUserDisplayName();
When I was open the execution details assign to name is showing but in order tasks assigned to field is showing empty.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2023 01:27 AM
where are you writing that script?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2023 03:24 AM
In flow designer While creating the order task action I selected Assigned to >scripted expand to edit in that iam writing the code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2023 03:42 AM
if you had a discussion with customer then what's the outcome
Who is the logged in user?
Because when flow runs it can run as system user or user who initiated the session
I already shared yesterday the point
are they referring to the user who raised the RITM?
if yes then do this
return fd_data.trigger.request_item.request.requested_for;
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2023 03:56 PM
In flow designer While creating the order task action I selected Assigned to >scripted expand to edit in that iam writing the code. Outcome is current logged in user?who initiated the session