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

Update Choice field on Label with a button OnSelect

Hi,

 

I have a gallery from SP list, contains a Text label, his text property (ThisItem.Status.Value) that represents the choice column in SP list, I Need to change the status on the text label to "Completed" when I press button.

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User
Super User

@haider96 

There may be a better way to do this but I found this worked for me.

  1. Put a Combobox anywhere on the screen (don't worry it will be hidden later) and call it cboStatus and set it's Items property to: Choices([@splist].Status) // replace splist with your list
  2. Set the DefaultSelectedItems property to: LookUp(Choices([@splist].Status),Value="Completed")
  3. Hide the Combobox.
  4. If the button is inside the gallery, OnSelect property: Patch(splist,ThisItem,{Status:cboStatus.Selected})
  5. If the button is outside the gallery:

 

Patch(
      splist,Lookup(
                    splist,ID=yourgalleryname.Selected.ID
             ),{Status:cboStatus.Selected}
)

 

 

 

View solution in original post

2 REPLIES 2
Drrickryp
Super User
Super User

@haider96 

There may be a better way to do this but I found this worked for me.

  1. Put a Combobox anywhere on the screen (don't worry it will be hidden later) and call it cboStatus and set it's Items property to: Choices([@splist].Status) // replace splist with your list
  2. Set the DefaultSelectedItems property to: LookUp(Choices([@splist].Status),Value="Completed")
  3. Hide the Combobox.
  4. If the button is inside the gallery, OnSelect property: Patch(splist,ThisItem,{Status:cboStatus.Selected})
  5. If the button is outside the gallery:

 

Patch(
      splist,Lookup(
                    splist,ID=yourgalleryname.Selected.ID
             ),{Status:cboStatus.Selected}
)

 

 

 

haider96
Frequent Visitor

Thank you it works!!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (4,288)