Skip to main content

Notifications

Community site session details

Community site session details

Session Id : nqNvX5qIOqxwf4985rM6Ko
Power Apps - Building Power Apps
Answered

Creating Button to capture Names and Email

Like (0) ShareShare
ReportReport
Posted on 21 Jul 2023 16:11:40 by 38

Hello All!

 

I created an app that has tasks/to-do's, I would like to implement a button thats called "submit". I would like it to have a function where when the user clicks submit it will capture their name/email and if possible the time it was clicked (the time portion isnt important if its not possible) mainly just name and email is the important part. I want this to be captured onto my sharepoint, I have created 3 coloumns as plain text that say manager, manager email, accepted time. How do i go about making this? any help would be appreciated. Thank You! 

  • Dongle12 Profile Picture
    38 on 21 Jul 2023 at 18:36:47
    Re: Creating Button to capture Names and Email

    This is perfect! Thank You! 

  • Verified answer
    madlad Profile Picture
    2,637 Super User 2025 Season 1 on 21 Jul 2023 at 18:31:20
    Re: Creating Button to capture Names and Email

    Just make sure Title is a text value, anything included like:

     

    {
     Title: "ATextValue",
     Manager: User().FullName,
     'Manager Email': User().Email,
     Time: Now()
    }

     

  • Dongle12 Profile Picture
    38 on 21 Jul 2023 at 18:26:51
    Re: Creating Button to capture Names and Email

    @madlad 

     

    Its unimportant in this case, would I add this in the fields where manager: user(), etc. are and just input Title: user()? Or would this be inputed after Patch('TCC EVENT 1', Title, Defualts.(...) ?

  • madlad Profile Picture
    2,637 Super User 2025 Season 1 on 21 Jul 2023 at 18:19:55
    Re: Creating Button to capture Names and Email

    Looks like you have a mandatory field 'Title' in  your SP list. I believe it's automatically created and can't be deleted. If it's unimportant to you, just include it in your Patch() with the other fields and put some filler data there to remove this error.

    You can also use it for your project if you wanted a main descriptive field for example, but you don't have to. 

  • Dongle12 Profile Picture
    38 on 21 Jul 2023 at 18:15:32
    Re: Creating Button to capture Names and Email

    @madlad 

     

    Almost!, i went ahead and fixed that extra ")" issue and it seemed to be okay, once I select the button i get a "Network error when using patch fucntion: Field 'Title' is required. 

  • Verified answer
    madlad Profile Picture
    2,637 Super User 2025 Season 1 on 21 Jul 2023 at 18:02:25
    Re: Creating Button to capture Names and Email

    Your quite close! All that's happening is you have one extra ")";

    hopefully this fixes the errors:

    Patch(
     'TCC Event 1', 
     Defaults('TCC Event 1'),
     {
     Manager: User().FullName,
     'Manager Email': User.Email,
     Time: Now()
     }
    )

     

  • Dongle12 Profile Picture
    38 on 21 Jul 2023 at 17:54:57
    Re: Creating Button to capture Names and Email

    @madlad 

     

    I understand a bit of this, i apologize as im still learning my way around power apps

    I attached where i have added the code to the button. I am still receving errors, "Unexpected Charcters. Charcters are used in the forumla in an unexpected way." . Help! 

     

    Based on signed in user is perfect and exactly what i was looking for. In my gallery i have a drop down where its defaulted to "incomplete" they will then change it to "complete" and click submit, from there their signed in info (name/emailed tied to their email account) get put into my sharepoint list columns under manager, manager email, accepted time. 

  • Verified answer
    madlad Profile Picture
    2,637 Super User 2025 Season 1 on 21 Jul 2023 at 17:31:34
    Re: Creating Button to capture Names and Email

    I see what you're saying! One thing you could try is using the Patch function. This will allow you to save this info, based on the signed in user's information- they won't even have to enter it anywhere.

     

    If you're updating a record you'll have to specify the record to update as the second field. It sounds like you maybe have a gallery where they will select items to update like this?

    If it's a new record you're creating, instead of specifying a record, use Defaults(YourDataSource).

    Here is some code similar to what you want:

    Patch(
     *YourDataSource*,
     Defaults(*YourDataSource*) OR *YourRecordToUpdate*,
     {
     Name: User().FullName,
     Email: User().Email,
     Time: Now()
     }
    )

    ^Please note, you have to fill in your table's name and column names here. 

  • Dongle12 Profile Picture
    38 on 21 Jul 2023 at 17:13:12
    Re: Creating Button to capture Names and Email

    Hey, @MAD !

     

    I have a Form (microsoft form) already where the manager will fill out and that info gets put into my SP and then filtered into my app. Do i still need to create a Edit Form in this case? For preference i did not add those criteria in the form as i want to make sure the managers dont delegate their tasks to others so i want to document who clicks on that submit button. 

  • madlad Profile Picture
    2,637 Super User 2025 Season 1 on 21 Jul 2023 at 16:41:15
    Re: Creating Button to capture Names and Email

    Hi! All of this is very doable! Here is a brief summary of the main steps you'll need to do

    Form:

    1. Firstly, You'll want to connect your SharePoint list to the canvas app if that hasn't been done yet.
    2. Then, create a Edit Form.
    3. Set the datasource as your SP List. Change the Default Mode to New. 
    4. Select Edit Fields > Add Field > select your fields. 
    5. Then, your form should auto-populate with appropriate question cards for each of these.
    6.  You can edit these, but you'll have to select each card, go to Advanced, and unlock the control first.
    7.  You likely want to change the Update() of the Time card to be Now()

    Submit Button:

    1. Create a button, change the text to "Submit"
    2. Change the OnSelect to SubmitForm(The Name of Your Form)
    3. Also add to the OnSelect ResetForm(The Name of Your Form)

    Additional documentation for Forms

     

    Hope this helps!

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,743 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,089 Most Valuable Professional

Leaderboard