cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RoScha
Helper V
Helper V

Update collection - is that possible?

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

1 ACCEPTED SOLUTION

Accepted Solutions
rubin_boer
Super User
Super User

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

 
hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.

View solution in original post

6 REPLIES 6
rubin_boer
Super User
Super User

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

 
hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.

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

@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
Super User
Super User

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

 
hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.
RoScha
Helper V
Helper V

@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
Super User
Super User

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.

 
hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,563)