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 / How to create a Collec...
Power Apps
Unanswered

How to create a Collection

(0) ShareShare
ReportReport
Posted on by 87

Collection is created with the following formula.
The DataSource uses a SharePoint list.

ClearCollect(
 SampleData,
 {Column1: Sample.Title, Column2: Sample.Column2, Colunn3: Sample.Column3}
);

スクリーンショット 2021-08-06 120257.jpg

 

However, if you create a Collection with this expression, it will look like a table and you will not be able to display the data.

Is it possible to display the data by making some changes in the formula to create the Collection?

スクリーンショット 2021-08-06 115515.jpg

 

※What I want to do in the future
Prepare two drop-down lists, one to select the value of Column1 and one to select the value of Column2.

Suppose I select "Sample" in the drop-down list of Column1, I want "AAA" and "BBB" to appear in the drop-down list of Column2.

 

 

Is it possible to have the above dropdown with the current collection?
Or do I need to work on the formula to create the collection?

If anyone has any good ideas on how to achieve this, please let me know.

 

 

Best regards,

Lopez

 

Categories:
I have the same question (0)
  • Verified answer
    GarethPrisk Profile Picture
    2,828 on at

    Simply, you should create Collections that match your date source.

    ClearCollect(
     colSharePoint,
     NameOfSharePointList
    );

    If/when you need to abstract that list, you can use functions like Choice(columnName) to get the values.

    Collect works this way, to recreate the table in the app with identical columns. You don't need to define the columns, unless you're trying to transform them or use column shaping functions.

  • BCLS776 Profile Picture
    8,994 Moderator on at

    You've got a few questions there, but I will try to answer a few of them.

     

    First, your current ClearCollect is forcing entire columns into a single record, which doesn't sound like you what you are after.

     

    ClearCollect(SampleData, Sample);

    Creates a copy of the Sample SP List as an internal collection. Normally you should not need to do that since you can reference Sample directly as a data source. If you need to do something different with the collection, let us know.

    For DropDowns, consider putting an expression of the following type into the Items property:

    Sample.Column2

    This makes all the fields in column2 available as dropdown choices, assuming they are text, number, string, etc.

     

  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    Hi @Lopez_0090 ,

    You can also do this.

    Clear(SampleData);
    ForAll(
     Sample As aCol,
     Collect(
     SampleData,
     {
     Column1: aCol.Title, 
     Column2: aCol.Column2, 
     Column3: aCol.Column3
     }
    )

     

     

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
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard