<< Click to Display Table of Contents >> Get User Related IDs |
This article provides guidance on how to retrieve various IDs associated with a user, such as User ID and Organization ID. We will explore different functions available in Bizagi Studio that facilitate this process.
To obtain the ID of a user working on a case, use the following function:
Me.Case.WorkingCredential.UserId
This function returns the ID of the current user working on the case.
However, recall that there are situations where using the Me object is not appropriate, such as in a Start event. The Me object retrieves information based on the context of the process, case, and task or element where it is executed. Since Start events lack process context, they return a null value.
If you need to get a user's ID without them working on a case, use the following function instead:
Credential.UserId
This returns the logged-in user's ID.
To obtain the ID of the organization related to a case, use the following function:
Me.Case.Organization.Id
This function returns the ID of the organization associated with the case.
Similar to retrieving the User ID, the Me object should not be used in Start events, as they lack the necessary process context, resulting in a null value.
If you need to retrieve the organization ID without relying on Me, use the following function:
Credential.Organizations
This function returns a list of all available organizations associated with the user who created the case.
To view all organization IDs, trace the organizations Id attribute with the following code:
var organizations = Credential.Organizations;
var idOrg = 0;
for(var i=0; i < organizations.Count; i++)
{
idOrg = organizations[i].Id;
CHelper.trace("OrganizationsFile",idOrg);
}
After executing this code, navigate to Management Console and follow the next steps:
1.Click the Track section and select the Tracing option.
2.In the Visualization tab, fill in the fields to filter trace files and click Apply filters.
3.Select the OrganizationsFile traces file and click the Download button.
4.Once the file is downloaded, open it with a text editor. You will find a list of the organization IDs associated with the user who created the case.
Last Updated 2/6/2025 4:35:10 PM