cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mike8
Level 10

Refresh gallery that has as items a nested table

Hello everyone,

 

Can you please help me on this..?

I have a collection:
ClearCollect(Collection1,{Column1:"A",Column2:Table({TableColumn:"1"},{TableColumn:"2"})})

A gallery that has as items:
Gallery1.Items: LookUp(Collection1,true,Column2)

And a button that has this in order to add an item to the table:
Button2.OnSelect: Collect(LookUp(Collection1,true,Column2),{TableColumn:"3"})

If you go and view the collection after pressing button2 you will see that a third record has been added in the collection but the gallery is not displaying it. I would like it to be displayed automatically.

Right now I use a variable to solve it but I would like to hear some ideas.

Thanks in advance

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support Team
Community Support Team

Re: Refresh gallery that has as items a nested table

Hi @Mike8,

 

I think a variable is the right solution here.

Gallery1 would just hold the filtered results, and once filtered, it will just hold the current value, if we have modified the items (Data source), then we need to make a condition to force the filter function under the items property of the gallery to run again.

Using a variable after the collect function, then using the if condition to check the variable value.

Button2 onselect property:

Collect(LookUp(Collection1,true,Column2),{TableColumn:"5"});
UpdateContext({Updated:true});UpdateContext({UPdated:false})

Gallery items property:

If(Updated=true,LookUp(Collection1,true,Column2))

If we configure the items property of the Gallery with the collection directly, then the value added would show up immediately.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ancherl
Level: Powered On

Re: Refresh gallery that has as items a nested table

Hi, @Mike8,

My idea mainly is consistent with @v-micsh-msft and I agree with you. But I make a bit change in the property of Button2 onSelect and Gallery items. 

The Property of Gallery items:

If(Updated=true,LookUp(Collection1,true,Column2),LookUp(Collection1,true,Column2))

The Property of Button2 onSelect:

Collect(LookUp(Collection1,true,Column2),{TableColumn:"3"});UpdateContext({Updated:true})

Best regards,

Ancherl

3 REPLIES 3
Community Support Team
Community Support Team

Re: Refresh gallery that has as items a nested table

Hi @Mike8,

 

I think a variable is the right solution here.

Gallery1 would just hold the filtered results, and once filtered, it will just hold the current value, if we have modified the items (Data source), then we need to make a condition to force the filter function under the items property of the gallery to run again.

Using a variable after the collect function, then using the if condition to check the variable value.

Button2 onselect property:

Collect(LookUp(Collection1,true,Column2),{TableColumn:"5"});
UpdateContext({Updated:true});UpdateContext({UPdated:false})

Gallery items property:

If(Updated=true,LookUp(Collection1,true,Column2))

If we configure the items property of the Gallery with the collection directly, then the value added would show up immediately.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ancherl
Level: Powered On

Re: Refresh gallery that has as items a nested table

Hi, @Mike8,

My idea mainly is consistent with @v-micsh-msft and I agree with you. But I make a bit change in the property of Button2 onSelect and Gallery items. 

The Property of Gallery items:

If(Updated=true,LookUp(Collection1,true,Column2),LookUp(Collection1,true,Column2))

The Property of Button2 onSelect:

Collect(LookUp(Collection1,true,Column2),{TableColumn:"3"});UpdateContext({Updated:true})

Best regards,

Ancherl

Mike8
Level 10

Re: Refresh gallery that has as items a nested table

Hello @v-micsh-msft, @Ancherl,

 

I am going to use your ideas. Thank you both Smiley Happy

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 56 members 4,889 guests
Please welcome our newest community members: