Workflow: Variable/Placeholder for "currentUser" ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dirk.dinger
    Junior Member
    • Nov 2018
    • 17

    Workflow: Variable/Placeholder for "currentUser" ?

    Hello Espo Community,
    I would like to send the name of the user that triggered a manual workflow as part of the header or payload of the HTTP POST Request.
    Is there a variable like {$currentuser.name} I can use ?
    Kind regards,
    Dirk
  • yuri
    Member
    • Mar 2014
    • 8438

    #2
    Hi Dirk,

    You can write the user name into a variable in an Execute Formula Script action added before your Send HTTP Request action. In the formula script:

    Code:
    $userName = env\userAttribute('name');
    Then, in your Send HTTP Request action in payload:

    Code:
    {
        "userName": "{$$userName}"
    }
    Note that if you need the username, use env\userAttribute('userName');
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • dirk.dinger
      Junior Member
      • Nov 2018
      • 17

      #3
      Thanks for your quick response. Works!!!

      Comment

      Working...