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
Solution Sage
Solution Sage

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
poweractivate
Community Champion
Community Champion

@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
Solution Sage
Solution Sage

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
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,436)