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 Pages / Prepopulate Contact an...
Power Pages
Suggested Answer

Prepopulate Contact and Account when Creating a Case.

(1) ShareShare
ReportReport
Posted on by 39
Hello all:
 
I am struggling to figure out how to pre-populate the Account and Contact when a logged on user creates a new case. It also occurred to me this seems like a security issue, if you look at the attached screens, I am logged in with a Contact Account, however in the Case Creation form, I can choose any customer and/or Contact to create a case on behalf of, this seems like a big security hole to me? IDK why it isn't a simple, OOTB feature that for a logged on Contact, when creating a case, the Account and Contact are read-only and automatically set to the logged on user? 

Can anyone help?
PortalCase1.png
PortalCase2.png
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,963 Moderator on at
    Hi
     
    I didn't look at the pictures yet, but Contacts respectively cannot log in. They are just "data in a table".
     
    The issue is not that they are a contact, its what permissions were given to them as Logged in Users.
     
    These things are different. So its not a security risk in the sense of the platform, its how you implemented it and whom is logged in and what permissions they are given :-)
  • Suggested answer
    Fubar Profile Picture
    8,491 Super User 2026 Season 1 on at
    The portal user can only see what you give them access to see - it appears you have created some Table Permissions with Global Read on Contact and Account, this is generally not recommended as it can create a security/privacy issue (try to limit Global to things like configuration/reference data e.g. like of categories).
     
    One of the issues will also be that Customer is a field type that can accept both a Contact and Account record (and not all Contacts will have an Account).  Several different approaches:
     
     
     
  • jstraumann Profile Picture
    39 on at
    @Fubar thanks for the detailed input! Unfortunately I had tried all this already with no joy. I tried to upload Pics and the Custom JS I did, but the site blocked it, so I put the files in a Zip on my Onedrive:   CaseCreateMetaData.zip

    Note the Case Create form is not in it's own web page, it appears as a pop up.
  • Suggested answer
    GWham Profile Picture
    58 Moderator on at
    On your form, go into it and add metadata.
     
    Select the attribute/field in the meta data and add one for contact
     
    Under pre-populate section, select the contact and from the dropdown logged in user.
     
    That will populate that lookup. You can also set a value on save of the form.
     
    Alternatively, set it with js on load if you wish .. something like...
    function populateLookup(fieldSchemaName, guid, name, tableSchemaName){
        $("#"+fieldSchemaName+"_name").val(name);
        $("#"+fieldSchemaName).val(guid);
        $("#"+fieldSchemaName+"_entityname").val(tableSchemaName);
    });
    
    populateLookup('contact', {{user.id}}, {{user.fullname}}, 'contact)
    
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Valantis Profile Picture

Valantis 59

#2
11manish Profile Picture

11manish 51

#3
omkarsupreme Profile Picture

omkarsupreme 27

Last 30 days Overall leaderboard