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

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

PytByt 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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

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