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 / Define acount based on...
Power Pages
Answered

Define acount based on logged user

(0) ShareShare
ReportReport
Posted on by 82

Hello,

 

I am looking for a way how automatically to fill in a field in a form of a portal with the company (acount name) of the logged in user. Sounded pretty easy to do it but so far I am failing.

 

At this moment I have created the contact (the person's name) and added it to the respective acount (the company name and details). Then I tried to connect a field which is a lookup connection with Account list but this is not helping....

 

Thanks

Categories:
I have the same question (0)
  • codevenkat Profile Picture
    126 on at

    Hi @dvoinikat ,

    Greetings . First make sure you have relevant entity permissions for your logged in user to account entity as well, then on the form load write an liquid logic to fetch data from account table based on the logged in user [you can use fetch xml from advanced find and then transform it to equivalent liquid syntax] . Assign the result account Guid to the Account lookup that is present in the form. 

    Note: Make sure you are referring to the information form in contact form 

     

    If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

    My Blog : https://venkatasubbaraopolisetty.com/

     

  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    Hi, you can set the value on save via Metadata: https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/configure-web-form-metadata#set-value-on-save

     

    if you need this to be pre-populated once they open the form, you will need to apply JS + Liquid: https://arpitmscrmhunt.blogspot.com/2016/09/adxstudio-set-values-in-lookup-fields.html

     

  • Verified answer
    H V Profile Picture
    1,510 on at

    Hi @dvoinikat 

     

    I believe you have account lookup in your entity form or custom entity form.

     

    Here, in my example, I have Appointment Basic Form As INSERT mode. In Appointment form, there is regardingobjectid field.

     

    Step1: Go to your Basic Form and click on "Basic Form Metadata" Tab.

    Step2: Click on "+ New Basic Form Metadata" button

     

    hardikv_0-1633626193854.png

     

    Step3: In the Basic Form Metadata, Select Type as Attribute and select your lookup field where you want to populate the Company Name.

    hardikv_1-1633626566337.png

     

    Step4: You will find "PrePopulate Field" section In the Basic Form Metadata.

    Select Type = Current Portal User

    From Attribute = Company Name (parentcustomerid) (Same as selected in screenshot)

     

    hardikv_2-1633626612253.png

     

    --------------------------
    If you like this post, give a Thumbs up. Where it solved your query, Mark as a Solution so it can help other people!

     

     

     

     

  • dvoinikat Profile Picture
    82 on at

    Thank you @hardikv! So in case I want to follow your guidance and make the company auto-populate I need to stick to Basic Web Form rather than Entity List?

  • H V Profile Picture
    1,510 on at

    Hi @dvoinikat 

     

    Yes, if you want to auto populate fields in the form, then you have to make changes in the Basic Form.

     

    --------------------------
    If you like this post, give a Thumbs up. Where it solved your query, Mark as a Solution so it can help other people!

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