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 / Update collection - is...
Power Apps
Answered

Update collection - is that possible?

(0) ShareShare
ReportReport
Posted on by 356

Hello common ones

I have a problem again and I need your help.

 

I create a collection when I start the app. This collection has 10 columns. And please imagine that these 10 columns are filled with the number 0 when you create them.

 

I would also like to add that this collection only ever contains 1 record.

 

Now I choose an action on another screen. The result of this action is that in column 5 of my collection, the NULL should become a 1.

How do I do it?

 

Best regards

RoScha

Categories:
  • Verified answer
    rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    hi @RoScha if this is your collection for example ClearCollect(_ThatCollection,{Col1: 0,Col2: 0,Col3: 0,Col4:0,Col5:0,Col6:0})

     

    Then seeing you will hav eone record only you can update col5 with 

    Patch(_ThatCollection,First(_ThatCollection),{Col5:1})

     

    hope that helps

     
  • RoScha Profile Picture
    356 on at

    Yes, that's the solution ... and again so easy in the end ... only I couldn't figure it out.

    Thanks a lot @rubin_boer for your quick help.

     

    Best regards

    RoScha

  • RoScha Profile Picture
    356 on at

    @rubin_boer 

    I have another question about that.

    Please imagine the following: Column 5 of the collection can contain either a 1 or a 0.

    Now I would like to control two buttons via the Visible property.
    Button 1 should be visible if there is a 1 in column 5 of the collection, button 2 should be visible if there is a 0 in column 5 of the collection.

    How can I do that with a collection?

     

    Best regards

    RoScha

  • rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    hi @RoScha sure you can add this to the visibility of the buttons

     

    Button visible on true: If(YourGallery.Selected.Col5=1,true,false)

    Button visible on false: If(YourGallery.Selected.Col5=0,true,false)

     

    Hope it helps

     
  • RoScha Profile Picture
    356 on at

    @rubin_boer I understood your solution as follows:
    I have to display my collection in a gallery and then I check the 1 or the 0 via the gallery.

    But that's not how I wanted to solve it.

    Can I check a column of a collection with the If statement?

  • rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    hi @RoScha sure change the YourGallery.Selected. to First(YourCollection).Col5

     

    Button visible on true: If(First(YourCollection).Col5=1,true,false)

    Button visible on false:If(First(YourCollection).Col5=0,true,false)

     

    that should do it.

     

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 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard