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 / OnSelect-multiple func...
Power Apps
Unanswered

OnSelect-multiple functions on button

(2) ShareShare
ReportReport
Posted on by 557
I have a button where when it is clicked - it updates the "Assigned To" to the person that is signed in.
 
I'd like to add two more functions to the same button:
 
1.  Could it update the "Status" Field (which is a choice column) to "In Progress"
2. Could it Auto-Save the record or push to save somehow?
 
Any help on those two items will help.  thank you.
 
 
 
Categories:
  • cfoenki Profile Picture
    100 on at
    Hi joel914823,
     
    I assume that you put on the DefaultSelectedItems of the field AssignedTo something like if(var_Assign=true,User(),Blank())?
     
    Then on the Status you should do something similar: if(var_Assign=true,{Value: "In Progress"},Blank())
     
    To help you with the save we need to now what is the datasource where you want to save your info.
  • joel914823 Profile Picture
    557 on at
    @cfoenki  Thank you so much! That worked....
     
    To save - the datasource is a Sharepoint list - and the list name is "Service Recovery Group"
  • cfoenki Profile Picture
    100 on at
    Glad the first part worked.
    Then you should Patch your record when the button is clicked.
    If it is a new record then just patch your SP datasource datasource:
    Patch('Service Recovery Group',
    Defaults('Service Recovery Group'),
    {'Assigned To':
        {
        '@odata.type': "Microsoft.Azure.Connectors.Sharepoint.SPListExpandedUser",
        Claims: "i:0#.f|membership|" & User().Email),
        Department: "",
        DisplayName: "",
        Email: "",
        JobTitle: ".",
        Picture: "."
        },
    Status: {Value: "In Progress"}
    }
    )
    This code only works if you have a column called "Assigned To" of type Person/Group and a column called "Status" with type Choice.
    Otherwise, just adapt.
     
    I supposed that you only click once on the button Auto-Assign and afterwards the button is greyed out
  • joel914823 Profile Picture
    557 on at
    @cfoenki  Thanks again - I must be doing something wrong as I inputted below but seems to error out.  
    Yes if there is a way to grey out the button that would be fantastic, how could I do that?


  • cfoenki Profile Picture
    100 on at
    My bad, just remove the bracket, I made a mistake when adapting my code:
    Patch('Service Recovery Group',
    Defaults('Service Recovery Group'),
    {'Assigned To':
        {
        '@odata.type': "Microsoft.Azure.Connectors.Sharepoint.SPListExpandedUser",
        Claims: "i:0#.f|membership|" & User().Email,
        Department: "",
        DisplayName: "",
        Email: "",
        JobTitle: ".",
        Picture: "."
        },
    Status: {Value: "In Progress"}
    }
    )
     
  • joel914823 Profile Picture
    557 on at
    Thanks @cfoenki you are awesome!

    To grey out the button after use....how could I do that  - or does the below automatically do it?  Thank you.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 320

#3
Mohsin Ali Profile Picture

Mohsin Ali 246

Last 30 days Overall leaderboard