web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Dynamically select mul...
Power Apps
Answered

Dynamically select multiple DefaultSelectItems for a Person or Group Combo control linked to SharePoint list allowing multiple selections

(0) ShareShare
ReportReport
Posted on by

I would like to dynamically select multiple DefaultSelectedItems of a combo form control linked to a SharePoint Person or Group column that allows multiple selections. The column in my SharePoint list is named ‘Approvers’.  The DataCardValue items property and DataCard Update properties are shown below:

  • Items:-> Choices([@Requests].Approvers).Email
  • Update:-> DataCardValue4.SelectedItems

 

To set the DataCardValue defaults, I created a collection (ApproverList) of user emails which is updated OnChange of the selection in another combo control used to derive the Approval Group ((Development or Maintenance).

I then use the ApproverList collection to set the DefaultSelectedItems property of the Approver combo as follows:

              ForAll(ApproverList,LookUp(Approvers, DisplayName.Email = ApproverEmail).DisplayName.Email)

bovellr96_0-1716730073012.png

 

However, the DefaultSelectedItems are not being updated in the SharePoint list when a new order request is submitted.

I would therefore be grateful for your assistance in identifying the error(s) in my scripts and\or suggest an alternative approach to achieve the desired result.

Categories:
I have the same question (0)
  • Verified answer
    bovellr96 Profile Picture
    on at

    Thank you both for your assistance. Neither of the above solution worked outright, but they served to point me in the right direction. I updated the 'Items' property to: Choices([@Requests].Approvers)  and the 'DefaultSelectedItems' property to return a table of Claims as suggested by @v-jefferni  and @EddieE  . However, the table of Claims on it's own did not select the required items by default and neither were the items updated in the SharePoint list. 

     

    For the solution, I therefore amended the ApprovalList collection  to include Claims, DisplayName & Email for the default approvers as follows:

    ClearCollect(ApproverList,ForAll(colApprovers,{Claims:ThisRecord.Value.Claims,DisplayName:ThisRecord.Value.DisplayName,Email:ThisRecord.Value.Email}))

    I then updated the  DefaultSelectedItems property as per @v-jefferni  to include the Claims, DisplayName and Email fields  which worked. See final solution below: 

     

    ForAll(ApproverList,{Claims:"i:0#.f|membership|"&Lower(LookUp(Approvers,Email=ThisRecord.Approver.Email).Approver.Email),DisplayName:LookUp(Approvers,Email=ThisRecord.Approver.Email).Approver.DisplayName,Email:LookUp(Approvers,Email=ThisRecord.Approver.Email).Approver.Email})​

     

    Conclusion:  SharePoint requires the Claims, DisplayName and\or Email fields in order to update the the SP List from the Combo DefaultSelectedItems property.

     

    Thanks again for your kind assistance. Much appreciated @EddieE  and @v-jefferni 

     

     

     

  • v-jefferni Profile Picture
    on at

    Hi @bovellr96 ,

     

    Please first change the Items property to Choices([@Requests].Approvers) if the Approvers column in Requests list is a people column. After that, DefaultSelectedItems property would be:

    ForAll(ApproverList,{Claims: "i:0#.f|membership|" & Lower(LookUp(Approvers, DisplayName.Email = ThisRecord.ApproverEmail).DisplayName.Email)})

     

    Best regards,

  • EddieE Profile Picture
    4,641 Moderator on at

    @bovellr96 

    Create your collection (ApproverList) using actual records from the Person field - use Filter to get names. This will create a 'table' of results, similar to the schema of a person field.

     

    The reason your patch/update isn't working is because you are trying to patch STRING values to a TABLE type field

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 400

#2
WarrenBelz Profile Picture

WarrenBelz 348 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 315 Super User 2025 Season 2

Last 30 days Overall leaderboard