cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

UpdateIf only working some times

I have a very simple statement below that works if I refresh my data source every now and then but then just tops working until I refresh again.

 

UpdateIf('[dbo].[PYR_NEW_ACCOUNTS]',STID=vNEWRECID,{STAT:"REVIEWED"});

 

I have validated that my variable vNEWRECID is being set correctly. I have tried hard coding the value into the statement just thinking it might be an issue with the variable but I get the exact same response.  I am getting no errors.  Any ideas on what might be causing this and/or how to get around it?

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: UpdateIf only working some times

Hi @Anonymous ,

Firstly, could you tell me why do you want to perform this formula for many times?

UpdateIf function could be used to update one or many records at the same time.

So when you act this action, all the records that meet this condition "STID=vNEWRECID" will be updated at the same time.

If you act this formula the second time, no action need to be acted, because all the records has already been updated.

If you want to update record one by one, I suggest you try Patch function.

For example:

Patch('[dbo].[PYR_NEW_ACCOUNTS]',the item that you want to edit,{STAT:"REVIEWED"})

 

 

Secondly, I've made a similar test and not met the same problem like your description.

If you think your connection has problems, I suggest you recreate connection with your data source.

You could also use refresh function every time before you act the formula.

For example:

Refresh('[dbo].[PYR_NEW_ACCOUNTS]');
UpdateIf('[dbo].[PYR_NEW_ACCOUNTS]',STID=vNEWRECID,{STAT:"REVIEWED"})

 

 

 

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.
Highlighted
Anonymous
Not applicable

Re: UpdateIf only working some times

I don't really need to loop each time I just want all rows with the vNewRecID to update but it is only updating the first record and not each one.  Only one record gets updated 😞

 

I tried adding the refresh and that didn't work either.

I also tried patch like this

 

ForAll(MaintUpdateList,Patch('[dbo].[PYR_MAINTREVIEW]',LookUp('[dbo].[PYR_MAINTREVIEW]', MNT_ID = MaintUpdateList[@MNT_ID]),{STAT:"REVIEWED"}))

 

and it doesn't do anything.  It doesn't throw any errors it just doesn't update any records.  

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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