Announcement
Collapse
No announcement yet.
How can I automatically assign a user to a contact?
Collapse
X
-
JosNas,
This Formula must be in the Action -> Execute Formula Script. Not in the Conditions.
Code:$userName = string\match(emailAddress, '/([^@]+)/'); $password = password\generate(); $hash = password\hash($password); $userId = record\create( 'User', 'userName', $userName, 'lastName', $userName, 'password', $hash, 'emailAddress', emailAddress); assignedUserId = $userId; assignedUserName = $userName;
Last edited by Vadym; 12-02-2021, 02:32 PM.
- Likes 2
Leave a comment:
-
-
Hi JosNas,
Code:$userName = string\match(emailAddress, '/([^@]+)/'); $password = password\generate(); $hash = password\hash($password); $userId = record\create( 'User', 'userName', $userName, 'lastName', $userName, 'password', $hash, 'emailAddress', emailAddress); assignedUserId = $userId; assignedUserName = $userName;
- Likes 1
Leave a comment:
-
How can I automatically assign a user to a contact?
I have a workflow that creates a User once a Contact is created. (Formula is below, and Target Entity is Contact)
Code:$emailAddress = string\substring(entity\attribute(emailAddress), 0); $userName = string\match($emailAddress, '/([^@]+)/'); $password = password\generate(); $hash = password\hash($password); $userId = record\create( 'User', 'userName', $userName, 'password', $hash 'emailAddress', $emailAddress );
Code:assignedUserId = $userId
Tags: None
Leave a comment: