cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Pablo2
Level: Powered On

problem with get gallery value after Patch

Hi,

 

When I update gallery field by Path it keep old value until end of "script".

Patch(AllColl, ThisItem, {Bin: "wow"});
Notify(Text(CountRows(Filter(AllColl, Bin = "wow"))));  -- get 0 result

Any ideas how to see changes after Patch?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: problem with get gallery value after Patch

Hi @Pablo2 ,

Do you mean that after you update your data source, the data does not update right now?

Please make sure that whether you've updated successfully.

What's more, if your data is large or app's function is complex, there will be data delay.

So this problem is very normal.

I suggest you refresh your data source before you check it.

For example:

Patch(AllColl, ThisItem, {Bin: "wow"});
Refresh(AllColl);
Notify(Text(CountRows(Filter(AllColl, Bin = "wow"))));

If the problem still exists, I suggest you try to use Timer control.

Adding some waitting time before you check the result.

For example:

set the Timer's OnTimeStart: Patch(AllColl, ThisItem, {Bin: "wow"});

set the Timer's OnTimeEnd:Notify(Text(CountRows(Filter(AllColl, Bin = "wow"))));

set the Timer's duration to 2 seconds 

 

Here's a doc about this control for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-timer

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: problem with get gallery value after Patch

Hi @Pablo2 ,

Do you mean that after you update your data source, the data does not update right now?

Please make sure that whether you've updated successfully.

What's more, if your data is large or app's function is complex, there will be data delay.

So this problem is very normal.

I suggest you refresh your data source before you check it.

For example:

Patch(AllColl, ThisItem, {Bin: "wow"});
Refresh(AllColl);
Notify(Text(CountRows(Filter(AllColl, Bin = "wow"))));

If the problem still exists, I suggest you try to use Timer control.

Adding some waitting time before you check the result.

For example:

set the Timer's OnTimeStart: Patch(AllColl, ThisItem, {Bin: "wow"});

set the Timer's OnTimeEnd:Notify(Text(CountRows(Filter(AllColl, Bin = "wow"))));

set the Timer's duration to 2 seconds 

 

Here's a doc about this control for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-timer

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
PytByt
Level 8

Re: problem with get gallery value after Patch

Hi @Pablo2 

As @v-yutliu-msft said, I think is better you refresh your data source right after the patch.

Cheer,

pytbyt

Helpful resources

Announcements
thirdimage

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors
Users online (6,139)