Flows and current user - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Aaron PersichAaron Persich 

Flows and current user

Hello,
 
I have built a flow and a button which is on the contact object.  When the user selects the button the flow will be kicked off and will create a custom related object record.  In the flow I need to map the OwnerId of the new record to the person who selected the button (Current User).  I am able the map the OwnerId to the Contact Owner Id but this is not ideal.  Is there a way I can map the OwnerId to the person who selected the button or the current user?  If so how can I accomplish this?
 
Thanks,
 
Aaron
 
Best Answer chosen by Aaron Persich
Mayank SrivastavaMayank Srivastava
Aaron,

Create a formula field within the Flow as shown below:

User-added image

And then within the Record Update element, assign the owner ID to be the above variable. That's it.

All Answers

Mayank SrivastavaMayank Srivastava
Aaron,

Create a formula field within the Flow as shown below:

User-added image

And then within the Record Update element, assign the owner ID to be the above variable. That's it.
This was selected as the best answer
Scott JohnsonScott Johnson
+1 Mayank.   I was just about to post the identical screenshot
Aaron PersichAaron Persich
Thanks guys.  You are a big help.

One more question.  Can I create a Flow, screen and custom button to kick off an approval process?

I know this is a seperate question and I would be more then happy to create another post if needed?
 
Mayank SrivastavaMayank Srivastava
Yes you can do that with a Flow.
Scott JohnsonScott Johnson
Absolutely.  I have a process that has a screen with some inputs and a radio button called Submit For Approval.  By default it is Yes, but the user can select No, which will create a case, but not submit it for approval.  If it is Yes, it creates the case, and submits it for approval

User-added image
 
Aaron PersichAaron Persich
Thanks agian gentz.  I will work on a custom approval process.  If I have any questions I will then submit a new question.

The Owner ID issue is resolved and works great.  Thanks for the help
Vincent TangVincent Tang

Resource Type: Formula | Data Type: Text | Formula: $User

For the newer version of Flow, this might be more helpful! 

(pick Global Variables: $User)