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 / how to keep few column...
Power Apps
Answered

how to keep few column only from the record source for display form

(0) ShareShare
ReportReport
Posted on by 2

I am working Teams power app. 

I made a collection on the screen visible. This collection has more than 50 column

on my screen i have a gallery, which is based on the collection above mention.

 

To display related data which is selected in the gallery , I inserted a display form and trying to get few required columns only to display, But it is showing error (shown in the image red underline and error description, surprised that it is showing clearcollect formula also wrong

 

Please check my mistake and advise

On Data source property, I am typing the below code

Clearcollect(CollectForDisplay1,ShowColumns(colAllList,"cr333_recono","cr333_machineid","cr333_model","cr333_serial"))

 

MIA27_0-1708626363081.png

 

Categories:
I have the same question (0)
  • Verified answer
    Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @MIA27 apart from "Clearcollect" being the wrong syntax (the correct formula name is "ClearCollect"), the Data Source property is expecting a Table, it is not to be used to initialise a Collection.

     

    Apply your ClearCollect statement onto the OnSelect property of a Button for example, and then in the Data Source property, only enter: CollectForDisplay1

  • MIA27 Profile Picture
    2 on at

    Dear Imran,

    Thank you so much for your advise.

     

    Just for my learning purpose and for future use, Can I add another collection underneath the same collection formula screen.

     

    I mean, my main collection "colAllList"   is happening on the first screen visible property, as my code is there, 

    Is it possible that under that formula, after putting ; sign I can add another collection based on the above. So that my both collection will be ready upon load of screen and can be used.

     

    Please advise.

     

  • Verified answer
    Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @MIA27 - yes you can chain multiple Collections within the same formula. e.g.:

     

    ClearCollect(
     MyCollection1,
     {
     Column1: "Text 1",
     Column2: "Sample 1",
     Column3: "A"
     },
     {
     Column1: "Text 2",
     Column2: "Sample 2",
     Column3: "B"
     }
    );
    ClearCollect(
     MyCollection2,
     {
     Text1: "Some text",
     Text2: "Some more text",
     Text3: "Even more text"
     }

     

    Note in the above example, MyCollection1 is generated before MyCollection2 is generated. If there is no relationship/dependency between the Collections, it is more optiminal to generate all Collections together using the Concurrent function.

     

    With this function, we do not need to use the semi-colon notation ( ";" ) and instead use the comma notation "," to separate each ClearCollect. (in the English version of Power Apps):

     

    Concurrent(
     ClearCollect(
     MyCollection1,
     {
     Column1: "Text 1",
     Column2: "Sample 1",
     Column3: "A"
     },
     {
     Column1: "Text 2",
     Column2: "Sample 2",
     Column3: "B"
     }
     ),
     ClearCollect(
     MyCollection2,
     {
     Text1: "Some text",
     Text2: "Some more text",
     Text3: "Even more text"
     }
     )
    )

     

    If there is a dependency between Collections - in other words you want to create another Collection which uses data from Collection1, you can use the following pattern:

     

    ClearCollect(
     MyCollection1,
     {
     Column1: "Text 1",
     Column2: "Sample 1",
     Column3: "A"
     },
     {
     Column1: "Text 2",
     Column2: "Sample 2",
     Column3: "B"
     }
    );
    ClearCollect(
     MyCollection2,
     Filter(
     MyCollection1,
     Column3 = "A"
     )
    )

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 914

#2
11manish Profile Picture

11manish 627

#3
Valantis Profile Picture

Valantis 598

Last 30 days Overall leaderboard