cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

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
Highlighted
Community Support
Community Support

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
Highlighted
Community Support
Community Support

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
Post Prodigy
Post Prodigy

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
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (3,930)