cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DAVIDPOWELL
Impactful Individual
Impactful Individual

keep old text patch also new text

I have 4 textboxes on a screen, no form.

I have a button on the screen.  patch is on this button

 

What I need:

If i change the value in the textbox i need to retain the old value

Then

and also patch my new value into a table?

is there a better way ?

 

Right now i'm doing this:  Using labels to store the old value but hidden from view.

 

Patch('[dbo].[Base_Information]',LookUp( '[dbo].[Base_Information]',
ID_Num = Value(ID_NUM_LBL.Text)),
{ OLD_QB_NAME: Current_qb_lbl.Text,

NEW_QB_NAME: NewQb_name_ddwn_cbo.Selected.EMPLOYEE_NAME,
OLD_QB_RACFID: racfid_qb_lbl.Text,
NEW_QB_RACFID: NewQb_name_ddwn_cbo.Selected.user_id

}

)

 

 

 

Thanks

Dave

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@DAVIDPOWELL 

Please consider changing your Formula to the following:

With({_oldRecord: LookUp('[dbo].[Base_Information]', '[dbo].[Base_Information]', ID_Num = Value(ID_NUM_LBL.Text))},

    UpdateIf('[dbo].[Base_Information]',
        ID_Num = Value(ID_NUM_LBL.Text),
       { OLD_QB_NAME: _oldRecord.NEW_QB_NAME,
         NEW_QB_NAME: NewQb_name_ddwn_cbo.Selected.EMPLOYEE_NAME,
         OLD_QB_RACFID: _oldRecord.NEW_QB_RACFID,
         NEW_QB_RACFID: NewQb_name_ddwn_cbo.Selected.user_id
       }
    )
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

1 REPLY 1
RandyHayes
Super User
Super User

@DAVIDPOWELL 

Please consider changing your Formula to the following:

With({_oldRecord: LookUp('[dbo].[Base_Information]', '[dbo].[Base_Information]', ID_Num = Value(ID_NUM_LBL.Text))},

    UpdateIf('[dbo].[Base_Information]',
        ID_Num = Value(ID_NUM_LBL.Text),
       { OLD_QB_NAME: _oldRecord.NEW_QB_NAME,
         NEW_QB_NAME: NewQb_name_ddwn_cbo.Selected.EMPLOYEE_NAME,
         OLD_QB_RACFID: _oldRecord.NEW_QB_RACFID,
         NEW_QB_RACFID: NewQb_name_ddwn_cbo.Selected.user_id
       }
    )
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,115)