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

Update Field Value with Button (onSelect)

Hello 

I am creating an app and I need to have users select either one of the two buttons (see image). Based on the button selected, I navigate to a different screen (Form ). Also based on the button selected I need to update a text field (from sp list). I am having a hard time figuring it out. Just FYI, these buttons are not in the form but the field I need to update is in the form.

 

Can you please help?

thejdofva_0-1638397056352.png

 

 

Thank  you

1 ACCEPTED SOLUTION

Accepted Solutions
cwebb365
Super User
Super User

Utilize variables. For the Button OnSelect, use Set(VariableName,"Value") assuming it's text, it can be other types, but using Text. Then for your Default in your form that needs to use the selected value, insert the VariableName above. If it's a drop down or something it gets a little tricker where you'll have to use Lookup's etc. in your default selecteditem etc. But using a variable is simplest way in your scenario. 

View solution in original post

2 REPLIES 2

@thejdofva 

Are you already keeping track of currently selected item with Gallery1.Selected or something like this?

If so, then just from any screen use Gallery1.Selected.YourColumnName - for example let's suppose Gallery1.Selected.YourColumnName is a text value. In that case, you can put this formula Gallery1.Selected.YourColumnName on the Text property of a Label control on any screen, for instance.

 

It will work from any screen, even different screen from the one Gallery is originally on. So then no need to update a text field from the SP list, it is already updated based on the selected item from the Gallery.

 

You repeat this for the other screen just using Gallery1.Selected.SomeOtherColumn for each of those controls.

 

Then each button OnSelect could simply have Navigate(Screen1) and Navigate(Screen2) for each button respectively.

 

Check if something like above helps.

 

cwebb365
Super User
Super User

Utilize variables. For the Button OnSelect, use Set(VariableName,"Value") assuming it's text, it can be other types, but using Text. Then for your Default in your form that needs to use the selected value, insert the VariableName above. If it's a drop down or something it gets a little tricker where you'll have to use Lookup's etc. in your default selecteditem etc. But using a variable is simplest way in your scenario. 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,903)