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

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

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

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

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,797)