1
votes

I am wrestling with a simple patch function to update a record based off the value of an text input control. What I want is for PowerApps to update a record where a value in a table = the value in a text input field.

Table2 contains my data. ID is unique for each row. ProjID is the name of the text input control. This contains the value of ID that I want to update. Current Phase is the column I want to update with the value in projID.

I have based the code below off some code which I use to create new records which works, so I think it is the lookup element that is not working.


Patch( Table2, lookup(Table2,Id = ProjID.Text ), { 'Current Phase': CurrentPhase.Text, } ) )

enter image description here


Any help would be greatly appreciated!

1
Welcome to StackOverflow! If you click in the arrow next to the red 'X', choose 'Edit in the formula bar', and hover on the expression with the red squiggly line, you should see more information about this error. You can also look at the "app checker" icon (it resembles a stethoscope) link on the top-right of the screen and it should have more information about your error.carlosfigueira

1 Answers

0
votes

The below should work and you can use comma either to add more conditions or data values

Patch( Table2,
                First(Filter(Table2, ProjID.Text = Id ) )
    , { 
     
         'Current Phase': CurrentPhase.Text                                 
      } 
)