cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

How to update a single value?

Hi

 

I've been messing arround with PowerApps, and I just don't get how it works. This is what I'm current;y trying to do.

 

I have a list of people. Each people has a few values, like Name, email, etc. And there is a value called NumberOfStrikes, which is a number.

 

In the details view of the person, I placed a button with the "+" sign next to the NumberOfStrikes vlaue. I want NumberOfStrikes to increase by one every time I press the button (and ideally, to save the update right away to the Data Source). So far I can't beguin to figure out how to do this.

 

I can't even change the text of the button when I press it. I tried using a formula on the OnSelect:

 

ButtonAdd.Text = "New Text"

 

I tried:

 

UpdateContext({Text:"New Text"})

 

But nothing I do has any result.

 

Any help would be apreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @JosePerez,

 

If here you are working with the Detail screen, then the formula under the OnSelect property of the '+' Sign should be:

 

UpdateContext({Input:Value(BrowseGallery1.Selected.NumberOfStrikes)+1});Patch(PeopleList,BrowseGallery1.Selected,{NumberOfStrikes:Value(Input)})

 

See if it would work in your scenario,

and if you have any further questions, please post back.

 

Regards,

Michael

 

 

 

Community Support Team _ Michael Shao
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

1 REPLY 1
Community Support
Community Support

Hi @JosePerez,

 

If here you are working with the Detail screen, then the formula under the OnSelect property of the '+' Sign should be:

 

UpdateContext({Input:Value(BrowseGallery1.Selected.NumberOfStrikes)+1});Patch(PeopleList,BrowseGallery1.Selected,{NumberOfStrikes:Value(Input)})

 

See if it would work in your scenario,

and if you have any further questions, please post back.

 

Regards,

Michael

 

 

 

Community Support Team _ Michael Shao
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

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (64,926)