cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mikerosoft_user
Frequent Visitor

Auto-populate an edit form combo box field from dataverse lookup.

Hey,

I have an edit form that I'm trying to auto populate with client information if it already exists in the dataverse. For example from my ccc_clients table I'm trying to pull the race value from a single choice column if a SSN matches. Here's the current code for DefaultSelectedItems of a choice column in an edit form:

 

 

 

LookUp(ccc_clients, SSN = ssnInput.Text, Choices(ccc_clients.Race).Value)

 

 

 

This doesn't throw any errors, but it doesn't auto populate the edit form 'Race' input with correct race value for the given SSN. It always populates the form with the first Race choice that was entered when creating the choice column.

 

I know working with choice columns can be tricky but it shouldn't be this hard.

 

1 ACCEPTED SOLUTION

Accepted Solutions
AhmedSalih
Super User
Super User

Hello, @mikerosoft_user, You need to use the Square Brackets in this case:

[LookUp(ccc_clients, SSN = ssnInput.Text, ccc_clients.Race)]

 

 

If my reply helped you, please give a 👍 , & if it solved your issue, please 👍 & Accept it as the Solution to help other community members find it more.


I am primarily available on weekdays from 6-10 PM CT and 5-10 PM CT on weekends.


Visit my Blog: www.powerplatformplace.com


 

 

View solution in original post

3 REPLIES 3
AhmedSalih
Super User
Super User

Hello, @mikerosoft_user, You need to use the Square Brackets in this case:

[LookUp(ccc_clients, SSN = ssnInput.Text, ccc_clients.Race)]

 

 

If my reply helped you, please give a 👍 , & if it solved your issue, please 👍 & Accept it as the Solution to help other community members find it more.


I am primarily available on weekdays from 6-10 PM CT and 5-10 PM CT on weekends.


Visit my Blog: www.powerplatformplace.com


 

 

Thanks for the response. I'll accept as the correct answer because you put me on the right track. For some reason the version you posted just results in a blank choice input, however if you put the brackets just around 'Race' it works perfectly.

 

LookUp(ccc_clients, SSN = ssnInput.Text, [Race])

@mikerosoft_user, you right, I didn't pay attention to the returned result Race inside your Lookup. I usually write this formula as below:

[LookUp(ccc_clients, SSN = ssnInput.Text).Race]

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Users online (5,512)