web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / UpdateIf only working ...
Power Apps
Unanswered

UpdateIf only working some times

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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?

Categories:
I have the same question (0)
  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    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 Power Platform Member Profile Picture
    Microsoft Employee on at

    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.  

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard