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

Notifications

Announcements

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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard