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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Manage datacardvalue f...
Power Apps
Answered

Manage datacardvalue for multiple persons

(0) ShareShare
ReportReport
Posted on by 6

Hi,

I am quite new with PowerApps and I hope PowerApps community can help me!

 

I use two Sharepoint Lists 

1) Request : which aims at managing travel requests and where an applicant can add location, dates, manager, ... In that list you have notably columns applicantN, managerN

2) Applicant : where all persons and their direct manager is indicated (column 1 : applicantName and column 2 : managerName)

 

I want to autopulate the manager DefaultSelectedValue of the Manager Combo box corresponding to the different applicantName selected (you can select several applicants). For example when you choose applicants A and B you have managerA and managerB selected automatically in the combobox.

I finally manage to perform it with the following code in the applicantN combobox (DataCardValue2) of the sharepoint form with the following code (where managerList is created on New Form)

 

Set(ManagerEmail;LookUp(Applicant;applicantName.Email=DataCardValue2.Selected.Email;managerName));;
Patch(managerList;Defaults(managerList);ManagerEmail)

 

In that case it works well when you add several applicants, but when you remove one it does not remove the corresponding manager. For example if I have applicants A and B and I remove applicant B, I only want to have applicantManager A in the managerN combobox.

 

Can you help me resolving this issue? I think I have this problem because I was not able to select all applicants (I thought that SelectedItems would have resolve this issue but I was not able to use it properly).

 

Many thanks in advance!

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    156,386 Most Valuable Professional on at

    Hi @jero_piz ,

    Try this - on the OnChange of the ComboBox

    Clear(managerList);;
    ForAll(
     Self.SelectedItems;
     Collect(
     managerList;
     {ManagerEmail: Value}
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • jero_piz Profile Picture
    6 on at

    Hi,

     

    Tanks for your quick answer.

     

    Unfortunately it does not work.

    First I replaced "Value" in your code because I had some errors and I used different solutions without a success.

    What is strange is when I add an user in the combobox it adds me a new line the Collection managerList but when I add another one, a new row is created but with twice the information of the last user. This is as this code only uses information of the last person I selected.

    Any other idea ?

     

     

  • WarrenBelz Profile Picture
    156,386 Most Valuable Professional on at

    @jero_piz ,

    Two things -

    What are the Items of your ComboBox? The reason you need to replace Value lies here. Either a Choice or a Lookup field needs Value. One based on a list needs the actual field name displayed.

    Secondly, did you put the Clear(CollectionName) at the top. I have actually tested this code on a model and it works exactly as expected. The code does not use the last one selected - it replaces what was there before with all selected items.

    MultiSelectCollect.gif

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • jero_piz Profile Picture
    6 on at

    Thank you.

    It partially solved my issue. I managed it with 2 lists :

    1) one to get record from applicants

    2) the other to compare these persons to my second sharepoint list

     

    I was able to display these names in the managerN combo box thanks to 

    DefaultSelectedItems = managerList.DisplayName

    But I was not able to save them in my Sharepoint list (because it is just a DisplayName  and not a full person record).

    How to display these multiple managerName and save them in Sharepoint?

     

  • WarrenBelz Profile Picture
    156,386 Most Valuable Professional on at

    Thanks @jero_piz ,

    I responded to the question you asked (I hope this solved it), but I do not use person fields (or any complex field types if SharePoint is my Power Apps data source), however here is a good thread on the subject.

    This video from Shane Young may be work a look regarding the issues.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • BrandonBenitez Profile Picture
    4 on at

    Y si quiero contar el total de opciones que seleccióno en mi DataCardValue como almacéno ese dato y como lo paso a otro DataCardValue de tipo número

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 379 Most Valuable Professional

#2
11manish Profile Picture

11manish 203 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard