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 / Create a collection an...
Power Apps
Answered

Create a collection and add SharePoint List data to collection

(0) ShareShare
ReportReport
Posted on by 141

Hello All,

 

I am trying to create a collection from the selected items of a combobox, however, I also want to add columns with additional data from a SharePoint list to be used later in the app. This is what I currently have, but I am struggling to get the additional columns added with the additional data. Could someone please assist?

 

 

 

If(
 IsEmpty(colSelectedCustomers) || 
 IsEmpty(Filter(colSelectedCustomers, Name = 'Search Existing Customers Combobox'.Selected.Title)),
 Collect(
 colSelectedCustomers,
 ForAll(
 'Search Existing Customers Combobox'.SelectedItems,
 {
 Name: ThisRecord.Title,
 Email: LookUp('Work Order Customer Data', StartsWith(Name, ThisRecord.Title)).Email
 }
 )
 ),
 Notify("Duplicate value: " & 'Search Existing Customers Combobox'.Selected.Title, NotificationType.Error)
);

Reset('Search Existing Customers Combobox');

 

 

 

Categories:
  • WarrenBelz Profile Picture
    156,545 Most Valuable Professional on at

    Hi @PJS-Data-Admin ,

    Firstly you do not need the first test as the second one will cover it (if it is empty so will the filtered version). Try this format

    If(
     IsEmpty(
     Filter(
     colSelectedCustomers, 
     Name = 'Search Existing Customers Combobox'.Selected.Title
     )
     ),
     Collect(
     colSelectedCustomers,
     AddColumns(
     ForAll(
     'Search Existing Customers Combobox'.SelectedItems,
     {
     Name: ThisRecord.Title,
     Email: 
     LookUp(
     'Work Order Customer Data', 
     StartsWith(
     Name, 
     ThisRecord.Title
     )
     ).Email
     }
     ),
     YourAddedColumnsHere
     )
     ),
     Notify(
     "Duplicate value: " & 'Search Existing Customers Combobox'.Selected.Title, 
     NotificationType.Error
     )
    );
    Reset('Search Existing Customers Combobox');

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • PJS-Data-Admin Profile Picture
    141 on at

    @WarrenBelz Thank you for the assistance! I am still having issues searching a SharePoint list and getting additional values from there. I then want to add them to columns in the collection based on the selected item in the combo box. This is what I tried and it did not work:

    If(
     IsEmpty(
     Filter(
     colSelectedCustomers, 
     Name = 'Search Existing Customers Combobox'.Selected.Title
     )
     ),
     Collect(
     colSelectedCustomers,
     AddColumns(
     ForAll(
     'Search Existing Customers Combobox'.SelectedItems,
     {
     Name: ThisRecord.Title
     }
     ),
     "Email", LookUp('Work Order Customer Data', ThisRecord.Title = Title, 'Email'),
     "Street Address", LookUp('Work Order Customer Data', ThisRecord.Title = Title, 'Street Address'),
     "Secondary Address", LookUp('Work Order Customer Data', ThisRecord.Title = Title, 'Secondary Address')
     )
     ),
     Notify(
     "Duplicate value: " & 'Search Existing Customers Combobox'.Selected.Title, 
     NotificationType.Error
     )
    );
    Reset('Search Existing Customers Combobox');

     

  • Verified answer
    WarrenBelz Profile Picture
    156,545 Most Valuable Professional on at

    Hi @PJS-Data-Admin ,

    Looking at your structure again, this is probably a better option

    If(
     IsEmpty(
     Filter(
     colSelectedCustomers, 
     Name = 'Search Existing Customers Combobox'.Selected.Title
     )
     ),
     Collect(
     colSelectedCustomers,
     ForAll(
     'Search Existing Customers Combobox'.SelectedItems As _Data,
     With(
     {
     _WO:
     LookUp(
     'Work Order Customer Data', 
     Title = _Data.Title
     )
     },
     {
     Name: _Data.Title,
     Email: _WO.Email,
     'Street Address': _WO.'Street Address',
     'Secondary Address': _WO.'Secondary Address'
     }
     )
     )
     ),
     Notify(
     "Duplicate value: " & 'Search Existing Customers Combobox'.Selected.Title, 
     NotificationType.Error
     )
    );
    Reset('Search Existing Customers Combobox');

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • PJS-Data-Admin Profile Picture
    141 on at

    @WarrenBelz Thank you very much, that worked!

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard