cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dvoinikat
Helper I
Helper I

Define acount based on logged user

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

1 ACCEPTED SOLUTION

Accepted Solutions
hardikv
Solution Sage
Solution Sage

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!

 

 

 

 

View solution in original post

5 REPLIES 5
codevenkat
Post Patron
Post Patron

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/

 

OliverRodrigues
Super User
Super User

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-v...

 

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

 




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

hardikv
Solution Sage
Solution Sage

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!

 

 

 

 

View solution in original post

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?

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!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,960)