cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Community Support
Community Support

Re: How to update a single value?

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

Re: How to update a single value?

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
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,953)