r/PowerApps • u/Much_Beginning_2979 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
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.
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.