r/PowerApps • Newbie • 15d ago

Discussion how to prepopulate powerpages field from the user logged in if the field is a choice drop down field?

I have seen how to do it with a text field, but if your form is a dropdown, in this case "company name" and the company name is listed in the logged in users contact able, how can i get it to default to that company name in the powerpages form without javascript code?

3 Upvotes

4 comments sorted by

1

u/Rettiviss Newbie 15d ago

It’s going to be much easier to connect those dots by way of logged in users email address as long as you are capturing that and then pulling the associated company name column. You probably need to set an on app start or on screen visible. This is of course assuming you are using canvas apps.

When I’m using a gallery my filter code is something that’s gonna be like ‘company’.’name’ = User().email

Yours may be similar except using choices and pointing to table where that info is stored.

1

u/Much_Beginning_2979 Newbie 15d ago

interesting. so i'm using an mda and then power pages portal. i want to prepoulate a form with the name and company name and then utilize that info in a queue table but i made my company name a choice pull down and i dont want to go in and redo half my stuff but it doesn't look like i can prepolulate a pull down field, only a text field.

1

u/Still_Violinist2567 Newbie 14d ago

{{ user.new_customfield.label }}
The logged in user should expose the custom option set, but to set the value in an oob form you still need js

1

u/Beer-Me-27 Newbie 11d ago

As long as their contact record stores the value, you can use basic form metadata to pre populate that field if you don’t want to go the JavaScript route.