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 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,679 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,679 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

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard