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 / Submit (Patch?) Office...
Power Apps
Answered

Submit (Patch?) Office365Users. details into SP List with one click without Form input. No Form.

(0) ShareShare
ReportReport
Posted on by 147

Hi,

 

Is it possible to create a button function that submits (patches?) Office365Users.MyProfile().<data> into a SP List column(s) without having a form?

 

What I want to do is have a visible (toggle) button called 'Sign me Up' (if not submitted already) and 'Remove Signup' (to Remove) the entry in a SP List column(s)? This is without a Form Edit. The user should not have to complete a form because Powerapps knows who he/she is already. Just click a button to submit/patch and then if they want to Remove, they click the toggled button - as explained.

 

For example: If a user clicks 'Sign me Up' button it automatically submits/patches their Office365Users.MyProfile().GivenName, Office365Users.MyProfile().Surname, and Office365Users.MyProfile().Email to the SP List and columns (FirstName, LastName, Email). The button then toggles to 'Remove Signup' in another color (Red) in case they want to Remove (function) their attendance and delete the entry from the SP List columns.

 

There is no Form so I cannot use 

 

SubmitForm(FormName);Office365Users.MyProfile().Email etc.

 

 

Can someone suggest an OnClick and setup elsewhere to do the above? Is it a Patch with vis/hidden toggle for each button text and color combo?

 

This is for the user experience to reduce inputs and make it easy for them.

 

Thanks,

 

Tom

Categories:
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Gigaenvy ,

    Could you please share a bit more about your scenario?

    Do you want to patch Office365Users.<data> back to your SP List without using a form?

     

    Based on the needs that you mentioned, I think  the Patch function could achieve your needs. I have made a test on my side, please consider take a try with the following workaround:

    2.JPG

    Add a Toggle control in your app, set the FalseText property to following:

    "Sign me Up"

    set the TrueText property to followig:

    "Remove Signup"

    set the Color property to following:

    If(Toggle1.Value,RGBA( 255, 0, 0, 1 ),RGBA(0, 0, 0, 1))

    set the OnChange property to following:

    If(
     Toggle1.Value,
     Patch('20190816_case6', Defaults('20190816_case6'), {Title: "Register Entry", FirstName: Office365Users.MyProfile().GivenName, LastName: Office365Users.MyProfile().Surname, Email: Office365Users.MyProfile().Mail}),
     RemoveIf('20190816_case6', Email = Office365Users.MyProfile().Mail)
    )

    On your side, you may type the following formula:

    If(
     Toggle1.Value,
     Patch( // Add new record 
     'Your SP List', 
     Defaults('Your SP List'), 
     {
     Title: "Register Entry", 
     FirstName: Office365Users.MyProfile().GivenName, 
     LastName: Office365Users.MyProfile().Surname, 
     Email: Office365Users.MyProfile().Mail
     }
     ),
     RemoveIf('Your SP List', Email = Office365Users.MyProfile().Mail) // Remove record
    )

    Note: FirstName, LastName and Email are all Text type columns in your SP List.

    Please consider take a try with above solution, check if the issue is solved.

     

    Best regards,

  • Gigaenvy Profile Picture
    147 on at

    Hey Kris! This works as a Toggle control perfectly.

     

    Two more quick questions:

     

    1) I would prefer a single button toggle (not toggle slider) so when Pressed down the button text label of the button changes from Signup to Remove Signup? If the person clicks Remove Signup, the patch removes the entry and the Button Text toggles back to Signup. I resolved this customization myself. I am now using a Button press using UpdateContext vars (not a Toggle control True/False like in your solution). I am able to Sign me Up and have the SP List update. The RemoveIF is not removing the entry when I click Remove Signup.

     

     

    2) And secondly, does your RemoveIf patch apply to that record item only? The person could have signed up for multiple Sessions on different days etc. I would only want the record for that RemoveIf removed not every.

     

    Here is the code. The Sign me Up button click adds a Title now into the SP List which corresponds to the item (Session Title) they are in.

     

    But it does not remove that entry based on the Title column nor the email. I want the record item for that Title to be removed when Remove Signup is clicked.

     

    Can someone help with the RemoveIf ?

     

    If(
     varSignup = "SignUp",
     UpdateContext({varSignup: "SignUp"}),
     UpdateContext({varSignup: "Remove Signup"}),
     Patch(
     'SP List',
     Defaults('SP List'),
     {
     Title: "Registered",
     FirstName: Office365Users.MyProfile().GivenName,
     LastName: Office365Users.MyProfile().Surname,
     Email: Office365Users.MyProfile().Mail,
     Session_x0020_Title: Title
     }
     ),
     RemoveIf(
     'SP List',
     Email = Office365Users.MyProfile().Mail
     )
    )

     

     

     

     

    Thanks,

     

    Tom

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Gigaenvy ,

    Have you solved your problem?

     

    If you have solved your problem, please consider go ahead to click "Accept as Solution" to identify this thread as Solved for other users in this forum.

     

    If you have any other questions about PowerApps, you could consider open another thread within this forum, then I would provide a proper workaround for you.

     

    Best regards,

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 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard