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 / Can I add an &&& state...
Power Apps
Unanswered

Can I add an &&& statement after Updating records

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

So I have been struggling to get an app to work .

All is in place but I need to change a varible after a record update.

 

So here is my code

Update(Table1_14,First(Filter(Table1_14, Name =DataCardValue1.Text && Time_x0020_Out<>Blank() && Time_x0020_In="")),{Time_x0020_In:Clock_5.Text, Location: "On Site"}) 

 

This all works but I want to add at hte end

 

&& UpdateContext({Variable:true})

 

can anyone help?

 

Rince

Categories:
I have the same question (0)
  • keathley Profile Picture
    142 on at

    @Anonymous Commands can typically be strung together by separating them with a ; 

     

    You might give this a try:

     

    Update(Table1_14,First(Filter(Table1_14, Name =DataCardValue1.Text && Time_x0020_Out<>Blank() && Time_x0020_In="")),{Time_x0020_In:Clock_5.Text, Location: "On Site"}) 
    ;UpdateContext({Variable:true})

    Good luck,

    Joey

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks Keathley

     

    I should have mentioned that I want the variable to change only if the table has been updated, otherwise I want it to stay false.

    If I separate it with a ; it always changes the varible

  • Shanescows Profile Picture
    2,218 Most Valuable Professional on at

    After the ; do an If to determine if it has changed. 

  • keathley Profile Picture
    142 on at

    @Anonymous I am not sure I follow if you want to know if the update failed or if it actually changed values.  If you want to know if it succeeded / failed you could use an "OnSuccess" property on the form.  If you want to know if the value changed you could wrap the variable update in an If to test for the change.  

     

    Joey

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I tried wrapping in an ifstatement before and it didn't work.

     

    What I ideally need is either to update an existing record or create new one if there is no existing record.

     

    By changing the variable i can submit the form if the variable is equal to the set value.

     

    I was exploring an alternant solution to the previous question I posed.

     

    However I have never used an onSuccess statement before.

    Something for me to look in to

     

    Thanks

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Shane

     

    How would the If staement check if table has been amended?

     

    Thanks

     

    Gareth

  • keathley Profile Picture
    142 on at

    @Anonymous Have you looked at Patch which can create or update records?

     

    Joey

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I have looked at patch too yes. 

     

    I can get the records to create and to edit separately. 

    I can also get the records to create new and not edit.

     

    I just cannot get the records to edit without creating a new instance too.

     

    Rince

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

Last 30 days Overall leaderboard