How to convert appRoleAssignments parameter from XML to only comma-separated string value of roles a user has in a Salesforce application?
Hello, I am using a Salesforce application integrated with Entra ID for SSO and user provisioning services. In my application, users are organized into several groups, and each user can belong to multiple groups.
I would like to store the roles assigned to a user in a specific field on the Salesforce User object. To achieve this, I have mapped the appRoleAssignments
attribute from Entra ID to a Salesforce field. However, the value received in Salesforce is a large XML structure containing the role information. This XML is not user-friendly and often exceeds 60,000 characters.
Additionally, if a user has multiple roles (e.g., three or more), the provisioning process fails because the field in Salesforce (a Long Text Area with a 131,072-character limit) cannot accommodate the data. This results in the error: STRING_TOO_LONG
.
Is there a way to transform the roles into a more concise format, such as comma-separated values, when sending them to Salesforce?