web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / When clicking a button...
Power Apps
Answered

When clicking a button, change status of column in SP list and get a mail

(0) ShareShare
ReportReport
Posted on by 693 Season of Giving Solutions 2025
Hi!!
 
I am creating a booking schedule from different rows in SP list, so when clicking a button, it should change the status from Available to Reserved (those are the 2 choices of the column. Then, get the team who reserved, which is the combo box into the Equip "column".
After that I would like to get a mail so I know someone has done a reservation.
The list looks like this:
So it has column type choice EQUIP, that is the last combo box, and when selected, click the button so it introduces that choice into the list, change the "Estat" (available) into "Reservat" (reserved) and get an email to know someone reserved that time.
What formula should I do? Do I need power Automate?
Categories:
I have the same question (0)
  • MS.Ragavendar Profile Picture
    6,090 Super User 2026 Season 1 on at
    Can you please share the patch function you have used in the button on select.
     
  • Charlie Martharper Profile Picture
    693 Season of Giving Solutions 2025 on at
     
    Patch(
        'Reserva data reunió desplegament GD',
        ThisItem,
        {
            Estat: "Reservat",
            Equip: DesplegableEquip.Selected
        }
    ),
     
    Notify(
        "Sol·licitud enviada correctament. Rebreu la convocatòria a l'agenda",
        NotificationType.Success
    )
  • Suggested answer
    MS.Ragavendar Profile Picture
    6,090 Super User 2026 Season 1 on at
     
    Created one set Variable to capture last item submission. 
     
    Set(varLastItemID,
        Patch(
            'Reserva data reunió desplegament GD',
            ThisItem
            {
                Estat: "Reservat"
                Equip: DesplegableEquip.Selected.Value
            }
        )
    );
     
    Checking if the last item submission estat value having Reservat if yes sending the email. 
     
    If(
        Lookup('Reserva data reunió desplegament GD',ID=varLastItemID).Estat= "Reservat",
        Office365Outlook.SendEmailV2(
            "To Whom you want to Sent",
            "What is the subject line of the eMail",
            "What is the body of the email"
        )
    );
    To send eMail from PowerApps itself you need to add Office 365 outlook connector inside the app.
     
     
    Notify("Sol·licitud enviada correctament.", NotificationType.Success)
     
     
    Please click Accept as solution if my post helped you solve your issue and help others who will face the similar issue in future.
    ❤️ Please consider giving it a Like, If the approach was useful in other ways.
    🏷️ Please tag me @MS.Ragavendar if you still have any queries related to the solution or issue persists.
  • Charlie Martharper Profile Picture
    693 Season of Giving Solutions 2025 on at
    Set(varLastItemID,
        Patch(
            'Reserva data reunió desplegament GD',
            ThisItem,
            {
                Estat: "Reservat"
                Equip: ComboBox1.Selected.Value
            }
        )
    );
    I dont know Why it doesn't get "This Item" and the Equip: i guess it should go the control of the combo box, right?
    Then will add the connector office 365 and add that last part into the OnSelect control button.
    Am I right?
  • MS.Ragavendar Profile Picture
    6,090 Super User 2026 Season 1 on at
     
    Are you creating new record or update existing record.
     
    If you creating new record (Patch)
     
     Patch(
            'Reserva data reunió desplegament GD',
    Defaults('Reserva data reunió desplegament GD'),
            {
                Estat: "Reservat"
                Equip: DesplegableEquip.Selected.Value
            }
        )
     
    If you Updating new record (Patch)
     
     Patch(
            'Reserva data reunió desplegament GD',
             Lookup(DataSource,ID=ThisItem.Id),
            {
                Estat: "Reservat"
                Equip: DesplegableEquip.Selected.Value
            }
        )
  • Charlie Martharper Profile Picture
    693 Season of Giving Solutions 2025 on at
    I am updating the item, so when clicking the button, it add the value from the combo box (ComboBox1) referring to the type choice column Equip and change the estat column to reservat.
    Should I change anything?
    I am getting errors. Like adding the name of the list in "DataSource" or ThisItem.
    Equip is on grey so I don't know if it is getting the information right
    The initial patch was made via copilot (a partner send it to me) so I don't really know if it's right or not.
    It has to update an item already created:
    Change that column from Disponible to Reservat, and then in equip get the value from the combobox.
    That first part, then we will focus on the mail part.
    i don't really know how the formula should look like, I think it's not correct the one it was sent to me.
  • MS.Ragavendar Profile Picture
    6,090 Super User 2026 Season 1 on at
    @Charlie,
    ThisItem will works from gallery or table or from. 
    From where you used to update from the item? It's from powerapps or SharePoint can you please provide insights.
  • Charlie Martharper Profile Picture
    693 Season of Giving Solutions 2025 on at
    I have 2 screens in the app, the first one gets all the items in the list, it means all the available times I have.
    So when the user selects one to reserve it, it sends you to the second one. Look at the first one:
    Tree view from this screen:
    When the click on any of these options, this screen comes:
    The only thing user has to do is, open the combo box, choose his option from the choice type column in the SP list and click on the button.
    When clickin the button, it has to take that value from the combobox into the "Equip" column and change the status of the "Estat" Column from "Disponible" to "Reservat".
    This is the second screen tree view:
     
     @Kalathiya do you know what could I do in this case?
  • MS.Ragavendar Profile Picture
    6,090 Super User 2026 Season 1 on at
     
    You might have navigated to the New Screen / Form based on the On Select event in the gallery or View Button . 
     
    If you are using button or Icon in the On Select Property
    • Set(varItemID,ThisItem.ID)
    If you are using Gallery Itself - We can use GalleryName.Selected.ID
     
     
    Form 
     
     
    In the Enviar peticio button (On Select) Property 
     
     Patch(
            'Reserva data reunió desplegament GD',
             Lookup(DataSource,ID=Value(varItemID)), // based on the button or gallery select this has to be updated. 
            {
                Estat: "Reservat"
                Equip: DesplegableEquip.Selected.Value
            }
        )
     
    Please click Accept as solution if my post helped you solve your issue and help others who will face the similar issue in future.
    ❤️ Please consider giving it a Like, If the approach was useful in other ways.
    🏷️ Please tag me @MS.Ragavendar if you still have any queries related to the solution or issue persists.
     
  • Kalathiya Profile Picture
    1,510 Super User 2026 Season 1 on at
     
    I have just reviewed all the comments, based on that, could you please try below things:
     
    Gallery On Select Property: 
    Set(g_SelectedItem, ThisItem);
    On Submit Form Code: 
    Patch(
            'Reserva data reunió desplegament GD', // Please 'Reserva data reunió desplegament GD' update with your SharePoint list name
             {ID: g_SelectedItem.ID},  
            {
                Estat:{Value:"Reservat"}, //Estat - If it's wrong please update with correct column name
                Equip:{Value: DesplegableEquip.Selected.Value} //Please correct the column name and dropdown control name if it's wrong. 
            }
        )
     
    Please let me know if you are still facing an issue. 
     
    If this response resolves your issue, please mark it as the Verified Answer so it can help other community members as well.
    ---------------------------------------------------------------------------------
     
    📩 Need more help? Mention @Kalathiya anytime!
    ✔️ Don’t forget to Accept as Solution if this guidance worked for you.
    💛 Your Like motivates me to keep helping!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 531 Most Valuable Professional

#2
Haque Profile Picture

Haque 261

#3
Kalathiya Profile Picture

Kalathiya 221 Super User 2026 Season 1

Last 30 days Overall leaderboard