cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mark2457
Helper II
Helper II

Save other fields in excel form?

Hi All

 

I made a power app from excel data source. I have a camera control and two read only fields Username and LastEditDate. I want these to display User().FullName and Now(), when the user takes a picture and then have them update the columns in excel on submit form (there are a few edit fields on form)

 

Can't get the fileds to update ion screen (tried: UpdateContext({UserName: User().FullName, LastEditDate: Now()}), but they don;t update on screen or in excel

 

Any suugestions?


Thanks

 

Mark

1 ACCEPTED SOLUTION

Accepted Solutions
v-monli-msft
Community Support
Community Support

Hi @Mark2457 ,

 

We use the UpdateContext function to create a context variable, which temporarily holds a piece of information, such as the number of times the user has selected a button or the result of a data operation. 

 

To update records from PowerApps to your data source, we usually use SubmitForm(if you have the edit form here) or Patch function.

 

You can:

Set the Default property of these 2 columns' data cards to User().FullName and Now(), and then use SubmitForm function to update the record.

 

Or you can:

Use a formula like:

Spoiler
Patch(Table1,Defaults(Table1),{UserName: User().FullName, LastEditDate: Now()})

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
mdevaney
Super User III
Super User III

@Mark2457 

Can you please share a screenshot of your form and a screenshot of your Excel.

 

I think you might have some misunderstanding of the UPDATECONTEXT function which is used to change a value stored within a variable.  In general there are 2 ways to control what happens when a record is inserted into the datasource.

 

  1. Update property of a DataCard within an EditForm
  2. PATCH function

 

If you can share those screenshots I've requested I'm sure the forum can help you out.

v-monli-msft
Community Support
Community Support

Hi @Mark2457 ,

 

We use the UpdateContext function to create a context variable, which temporarily holds a piece of information, such as the number of times the user has selected a button or the result of a data operation. 

 

To update records from PowerApps to your data source, we usually use SubmitForm(if you have the edit form here) or Patch function.

 

You can:

Set the Default property of these 2 columns' data cards to User().FullName and Now(), and then use SubmitForm function to update the record.

 

Or you can:

Use a formula like:

Spoiler
Patch(Table1,Defaults(Table1),{UserName: User().FullName, LastEditDate: Now()})

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thanks Mona

 

I think I follow, but where do I run the Patch function? From the submit button, after "SubmitForm(EditForm1)"?

 

Regards

 

Mark

Here's a screen shot and the excel

 

PowerApps2.pngPowerApp1.png

 

 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,398)