cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Manuel_O
Helper I
Helper I

Newby's first button

Hello,

 

I'm just about doing my first PowerApp, watched the videoes and read some documentation, but seemly I'm not able to get a proper result.

For my first test, I'm connected tp an excel table on oneDrive, I made an app out of the data and this works fine. Now I try to add a button that feeds a field with a value. I tried with:

 

Update( Tabelle2, { Stamp: 0 } )

on the onSelect property. The table's name is Tabelle, the field is stamp. Can someone tell me what the correct syntax would be?

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Manuel_O

 

Yes, it is correct to use a semi-colon instead of a comma when you run PowerApps in German.

 

Here is something that I posted earlier this week that explains this behaviour.

 

https://powerusers.microsoft.com/t5/General-Discussion/Combining-2-actions-for-a-Button/m-p/84045#M3...

View solution in original post

9 REPLIES 9
Anonymous
Not applicable

The update fx updates a whole record in the table and expect the old record, then the new record (old to update)

UpdateIf can modify value(s) in record(s)

 

Examples: https://docs.microsoft.com/en-us/powerapps/functions/function-update-updateif

timl
Super User
Super User

Hi @Manuel_O

 

It looks like you're trying to update an existing record in your Excel spreadsheet.

 

With PowerApps, there are a few functions that can carry. The two main ones are Update and Patch. Update replaces an entire record in a table, whereas Patch updates one or more values in a record and the other values alone. In both cases, we need to specify the record to update and this is the bit that's missing in your formula.

 

Assuming that you added a gallery control called BrowseGallery1 that shows records from Tabelle2, the formula to update the currently selected record would be:

 

Patch( Tabelle2, BrowseGallery1.Selected, { Stamp: 0 } )

 

Thank you!

I changed it to:

 

Patch( Tabelle2, DetailForm1.Selected, { Stamp: 0 } )

to fit the controls name (DetailForm1)..but it still does not work: ("Expected:: ParenClose; Found: Error" says fhe warning sign). 

Hi @Manuel_O

 

DetailForm1 is the control that displays a single record, so unlike the gallery control, it doesn't have a Selected property.

 

To find the record that you're updating, I recommend that you look at the properties of DetailForm1. The Item property defines the record that the detail form shows. This is the value that you should provide as the second argument to the Patch function.

 

 

DetailForm1.JPG

"BrowseGallery1.Selected" seems to be correct, following your tips. But I still get errors:

PA.jpg

It seems to work when I use semicolons instead of commas:

 

Patch( Tabelle2; BrowseGallery1.Selected; { Stamp: 0 } )

Hi @Manuel_O

 

Yes, it is correct to use a semi-colon instead of a comma when you run PowerApps in German.

 

Here is something that I posted earlier this week that explains this behaviour.

 

https://powerusers.microsoft.com/t5/General-Discussion/Combining-2-actions-for-a-Button/m-p/84045#M3...

Thanks, I did not know this. Even the code examples in the german(!) documentation are with commas and therefore don't work here. 

Good to know! Thank you all for the help!

You're welcome! I'm glad I could be of help.

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,970)