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 / Best way to make a sec...
Power Pages
Answered

Best way to make a secure submission on forms with dynamic users

(0) ShareShare
ReportReport
Posted on by 2,434 Super User 2025 Season 2

Hi @Fubar,

 

@ragavanrajanas you have also been in the post I refer to. Mentioning you as well.

 

Post I refer to: https://powerusers.microsoft.com/t5/General-Discussions/Adding-icon-as-navbar-element-instead-of-text/m-p/2471665#M5456

 

Coming back to your answer on another post:

Lucas001_0-1701251894421.png

I am aware of the mentioned security issue.

Question would be if I have a form and submit that the metadata does not show who submitted the data.

As different users would be possible the contact is dynamic and a weakness in security. Question would be on how to get the contact value without somehow passing the value with the form via lookup or something similar.

 

Do you guys have some recommendations?

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

    You can store the Logged in Portal User via Form/Step Metadata (you can also get their Account) use the portal/Pages Management App to setup the Metadata .

    https://learn.microsoft.com/en-us/power-pages/configure/configure-basic-form-metadata#set-value-on-save

    All you do is create a Lookup for your Table to hold the Portal users Contact record (and account also if you want), and then use the onsave settings in the metadata.

    (As your form/step will be either an Insert or Edit/Update you can do both created by portaluser and modified by portal user).

     

    By 'Dynamic' what i was referring to is probably more of a specific example, that you will see if you've set up a Customer Self-Service portal where they populate a Customer lookup on the Case table, in that code they use JavaScript because if the logged in Portal User has an Account they populate it in the Customer Lookup and the Portal user in the Contact Lookup, but if the Portal User does not have an Account they only populate the Portal User in the Customer Lookup (and as that scenario logic cannot be covered by Metadata they dynamically set the values using JavaScript).

  • Lucas001 Profile Picture
    2,434 Super User 2025 Season 2 on at

    Hi @Fubar,

     

    haven't been aware of that solution.

    Somehow I get an error when trying to populate the contactid which I would need to later use it in my flows.

    It works with all other fields I tested (createdOn, email, fullname etc).

    Filling out the value does not change a thing.

    Do you know how to fix that?

     

    Filled out metadata:

     

    Lucas001_1-1701346136723.png

     

    Value of attribute inside field:

    Lucas001_0-1701346111845.png

    Cleartext: "Microsoft.Xrm.Sdk.EntityReference"

     

  • Verified answer
    Fubar Profile Picture
    8,354 Super User 2025 Season 2 on at

    Make sure the Value field is empty, and the Attribute you selected at the top of the form is a Contact lookup field.

     

    Fubar_0-1701385012133.png

     

     

     

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
Fubar Profile Picture

Fubar 78 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 75

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard