In Flow Designer, for order task i want to auto populate assign to field is current logged in user

nidhi40
Tera Contributor

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

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@nidhi40 

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.

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

View solution in original post

13 REPLIES 13

Peter Bodelier
Giga Sage

As far as I know, that is not possible. You can't access the user for whom the flow is running either.

Aren't you able to use information on the record for this?


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

Riya Verma
Kilo Sage
Kilo Sage

Hi @nidhi40 ,

 

Hope you are doing great.

 

you can autopouplate the logged in user in assigned to in flow designer bybelow steps :

  1. Locate the flow that corresponds to the order task, find the point where you want to set the "Assign to" field to the current logged-in user.

  2. Add a new action to update the order task .

  3. Within the action or condition block, click on fx to use below code snippet:

 

task.assign_to =  gs.getUserID();

 

4. Save the change in flow 

Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Regards,
Riya Verma

Hi Riya ,

1.above code is not working, error like.... "task" is not defined.,Detail: "task" is not defined.

2.if i give this code assign_to =gs.getUserID(); also not working

@nidhi40 

Did you discuss with your customer about the requirement?

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