How to convert appRoleAssignments parameter from XML to only comma-separated string value of roles a user has in a Salesforce application?

Bianca Micu 0 Reputation points
2025-01-21T08:27:13.25+00:00

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?

Microsoft Entra
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,996 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.