Announcement

Collapse
No announcement yet.

Get current user in manual workflow?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Get current user in manual workflow?

    Hi, sorry, do you know how to get a user in the workflow that is being triggered manually?

    (I need to create a note (steam) saying 'Triggered by user.first_name')

    Thanks

  • #2
    Hi Russ,

    You can use env\userAttribute function to get any attribute of the current user: https://docs.espocrm.com/administrat...vuserattribute.

    Please use Create Record > Note action in your workflow with using the following formula script:
    Code:
    $userFirstName = env\userAttribute('firstName');
    
    parentId = workflow\targetEntity\attribute('id');
    parentType = 'Lead'; // сhange the Lead to the name of the entity that is the Target Entity of your workflow
    
    post = string\concatenate('Triggered by ', $userFirstName);​
    ​

    Comment


    • #3
      Originally posted by lazovic View Post
      Hi Russ,

      You can use env\userAttribute function to get any attribute of the current user: https://docs.espocrm.com/administrat...vuserattribute.

      Please use Create Record > Note action in your workflow with using the following formula script:
      Code:
      $userFirstName = env\userAttribute('firstName');
      
      parentId = workflow\targetEntity\attribute('id');
      parentType = 'Lead'; // сhange the Lead to the name of the entity that is the Target Entity of your workflow
      
      post = string\concatenate('Triggered by ', $userFirstName);​
      ​
      thank you so much!

      Comment

      Working...
      X