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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / How to capture email a...
Power Pages
Unanswered

How to capture email address of logged in portal user for use in a Power Automate cloud flow?

(0) ShareShare
ReportReport
Posted on by

Hello Everyone.

 

My portal requires that it a user is signed in before it can be accessed.  How can I access that email address for later use in a Power Automate cloud flow? 

E.g. to then send an email from the email address of the logged in portal user?

 

Or, as my portal has forms that a logged in user must fill out and submit, can I capture the logged in user's email address as part of the form submission? 

E.g. by adding a label or something to capture the email address when the form is submitted?

Many thanks for any help.

Categories:
I have the same question (0)
  • Fubar Profile Picture
    8,338 Super User 2025 Season 2 on at

    The answer may vary slightly depending on what authentication method you are using.  But first check to see if it is already being captured as part of user registration  - look at the Contact record for the Portal User and check the Email field (address1_email)

     

     

    The general answer would be to make user of the existing Profile form, you can force it to be submitted prior to accessing other pages. e.g. user registers, fills in additional info on Profile page, continues using the site. to force it you need to update (or create if not already present) in the Portal Management App the Site Setting "Profile/ForceSignUp" to true  https://learn.microsoft.com/en-us/power-apps/maker/portals/configure/configure-site-settings#portal-site-settings

     

    If you have configured your own identity provider, and the Email address is not already being populated on the Contact record then you may need to add addiotion Claims Mapping. https://learn.microsoft.com/en-us/power-apps/maker/portals/configure/configure-openid-settings#configure-additional-claims

     

    If the Contact record for the Portal User already exists (one is created when the Portal User registers), and the Email Address field is already populated then you can record/copy it when a form is submitted via Form Metadata using .Current User's Contact https://learn.microsoft.com/en-us/power-apps/maker/portals/configure/configure-basic-form-metadata (either prepopulate a field on the form or just save it in a field behind the scenes)

     

    You can create a form and add a text field for the user to fill in and store it on submit of the form.

  • CU-19081228-9 Profile Picture
    on at

    Thanks always for helping me out @Fubar!!  See my comments in bold.

     

    The general answer would be to make user of the existing Profile form, you can force it to be submitted prior to accessing other pages. e.g. user registers, fills in additional info on Profile page, continues using the site. to force it you need to update (or create if not already present) in the Portal Management App the Site Setting "Profile/ForceSignUp" to true  https://learn.microsoft.com/en-us/power-apps/maker/portals/configure/configure-site-settings#portal-... - I have now enabled this on my portal and users have to sign in to access it.

    If the Contact record for the Portal User already exists (one is created when the Portal User registers), and the Email Address field is already populated then you can record/copy it when a form is submitted via Form Metadata using .Current User's Contact https://learn.microsoft.com/en-us/power-apps/maker/portals/configure/configure-basic-form-metadata(either prepopulate a field on the form or just save it in a field behind the scenes) - This is what I am struggling with.  How do I add a prepopulated field to my form with the email address?  

    I looked at the basic form metadata option.  I don't understand how to add a new field to my form that contains the current user email address.  In my form data table, I made a new field called 'Submitted By', how do I tie this with the Current User's Contact Email Address? 

    My idea is to then hide that field so that when the form is submitted the email address of the logged in user is captured and I can use it.

    Thank you so much!

  • Fubar Profile Picture
    8,338 Super User 2025 Season 2 on at

    @ianwuk wrote:


    My idea is to then hide that field so that when the form is submitted the email address of the logged in user is captured and I can use it.

    Thank you so much!


    If the data is already stored on the Contact record you do not need to pre-populate it to fill in a Submitted By scenario (you would only pre-populate if you wanted to display it to the user prior to submit).  The Metadata has an Set Value On Save and you use this section.

     

    We usually do not work with Email address (but you can store it if you want to), but with the Contact record itself e.g. someone can change the Contact's email address, and the linkage between records is based on Contact not the actual email address.

     

    Your Dataverse table will need field(s) to store the value(s) a Lookup field to Contact and/or Single line text field (for the Email address).  For the Form in question you need to edit its definition (from Portal Management App) and for each attribute/column you want to populate on save

    • add a Metadata record (it will either already be a Tab on the form definition or will be under the 'Related' Tab),
    • set the Metadata  type = Attribute
    • set Attribute = to the column that the value is to be stored in
    • then fill in the Set Value On Save section further down the page
    • in that section: Set Value On Save = ticked
    • in that section: Type = Current User's Contact
    • in that section: Form Attribute = the column on the Contact record that you want to save (into the column set in the the Metadata's Attribute ).

    Save and close, then sync your portal and submit the portal form.

     

     

  • CU-19081228-9 Profile Picture
    on at

    Thank you very much @Fubar - let me try this and get back to 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard