cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Mark2457
Level: Powered On

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
Community Support Team
Community Support Team

Re: Save other fields in excel form?

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

Re: Save other fields in excel form?

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

Community Support Team
Community Support Team

Re: Save other fields in excel form?

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

Mark2457
Level: Powered On

Re: Save other fields in excel form?

Thanks Mona

 

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

 

Regards

 

Mark

Mark2457
Level: Powered On

Re: Save other fields in excel form?

Here's a screen shot and the excel

 

PowerApps2.pngPowerApp1.png

 

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 341 members 6,523 guests
Please welcome our newest community members: