cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,215)