Is there a list of all available system attributes for the record, and also for the user?
I checked the reference, but I didn’t see CreatedBy or UpdatedBy as options for the record.
How does Corteza uniquely identify users? Is there an ID number, or does it use the handle attribute?
1 Like
Lenny
March 31, 2024, 4:33am
#2
Hi,
This is the response when you get a user:
{
"response": {
"userID": "359617995137351684",
"username": "",
"email": "qsbadzss@sharklasers.com",
"name": "qsbadzss",
"handle": "qsbadzss",
"kind": "",
"meta": {
"avatarID": "359618043170521092",
"avatarKind": "avatar-initials",
"avatarColor": "#162425",
"avatarBgColor": "#F3F3F3",
"preferredLanguage": "en",
"securityPolicy": {
"mfa": {
"enforcedEmailOTP": false,
"enforcedTOTP": false
}
}
},
"emailConfirmed": true,
"createdAt": "2023-10-17T21:23:49Z",
"updatedAt": "2023-10-17T21:24:17Z",
"canGrant": true,
"canUpdateUser": true,
"canDeleteUser": true
}
}
You can see there is a handle (user.handle) and this value is indeed unique. user.email is also unique. So you can use those values to find a user in a workflow (iterating over users and seeing if the handle or email match to what you are looking for).
But, inside Corteza, the userID is used to reference a user (user.userID, similar to record.recordID). So when you look at the value of record.ownedBy you’ll see that ID.
Hope this makes it clearer.
OK, so that’s what you get if you pull it as a resource, either by ID number or through a search. that’s good.
Is there a way to pull the current (logged in) user attributes?
Lenny
April 1, 2024, 7:45am
#4
Yes, you can get the currently logged-in user with the “invoker” variable. This variable contains the ID of the user that triggers the workflow.
As you can see, I retrieve it as a string and after that I change it into a “ID” format for my workflow. For example, to do a user lookup.
2 Likes
Is there a way to determine if a user is suspended or not?
Also, what is the difference between user.name and user.username?
jfortun
September 11, 2024, 2:03pm
#6
So, if the SuspendedAt field is populated, the user is suspended?
Does unsuspending the user clear the SuspendedAt field?
jfortun
September 16, 2024, 10:26am
#8
Best you try and see, afaik yes.