Search code examples
azure-active-directorypowerapps

Store Azure AD group members names to person type column in powerapp


I have dropdown that selects an Azure AD group based on a condition.

The members of the group are already stores in a variable using the code below.

Set(varL2opgcUsermembers, AzureAD.GetGroupMembers("b59ff3f6-31f7-45cd-bd1b-142e36dd3cb2").value);

I have a person type column in sharepoint (Allow multiple selection is enabled for this column).

I want to store the members from the above variable to this column with display names of the members.

How can i achieve this?

Thanks in advance

The members of the group are already stores in a variable using the code below.

Set(varL2opgcUsermembers, AzureAD.GetGroupMembers("b59df3f6-35f7-45cd-bd2b-142e86bd3cd2").value);


Solution

  • Here is the solution.

    Patch(TestList, // sharepoint list Defaults(TestList), // sharepoint list {Title:"Test", GroupMembers: //sharepoint column name ForAll( varGroupMembers, //variable or collection where member are stored {Claims:"c:0t.c|membership|"& userPrincipalName, Email:"", Department:"", DisplayName:"", JobTitle:"", Picture:""})});