Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Populating a form value from a SharePoint list depending on selection of a dropdown field

I have a power app form that is dependent on 2 SharePoint lists (LABS_LIST and LABS_NAMES) The form I'm working on is used to update or create a new record in the LABS_LIST SharePoint list. I'm using the LABS_NAMES list to populate a dropdown and a text input on my form. The LABS_NAMES list contains the fields LAB_NAME and LAB_POC LAB_NAME is the name of the lab and LAB_POC is the person to contact for the lab. Example - LAB_NAME = "Southwest", LAB_POC = "Doe, John".


I'm populating the dropdown with all the lab names. When a user selects a lab name, I want the text input to be populated with the corresponding lab POCs.


So if I select Southwest as the lab in my Dropdown2 dropdown, then the text input DataCardValue29 for the lab poc would be updated with "Doe, John"


Here is my code for my dropdown (Dropdown2) - Code assigned to "Items"

        {LABMenuOptions: Table({'LAB_NAME': Blank()})},
        If(labRole = "POC",
        {LABMenuOptions: Filter(LAB_NAMES, 'LAB_POC'.Email=varUserEmail).'LAB_NAME'},
        {LABMenuOptions: LAB_NAMES.'LAB_NAME'}


My code for the input (DataCardValue29) - Code assigned to "Default"



So far my If statement for the DataCardValue29 input field has errors and when I test and make a selection in Dropdown2, the DataCardValue29 field is not updated with the LAB_POC's name.

Super User
Super User

Without seeing the error for input, my guess is that the Filter() should actually be a Lookup() because the filter is returning a table column and the input field is expecting text.


Try this instead:


If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

I tried something different. The fields of my SharePoint list, LAB_NAMES are 'LAB NAME', which is a text field, and 'LAB OWNER' which is a person field.


For the OnSelect of the Dropdown2 form element I created a collection:

Collect(colLABNAMES, Filter(LAB_NAMES, StartsWith('LAB NAME',Dropdown2.Selected.'LAB NAME')));


That should return all the columns from the LAB_NAMES list where a specific lab name was selected above, basically a single record.


After I create the collection, I try to update the text of the TextInput1.Text field :

TextInput1.Text = colLABNAMES.'LAB_x0020_OWNER'.

However i get the error "Incompatible types for comparison. These types cant be compared: Text, Table"


Here is the complete code from my Dropdown onSelect:


Collect(colLABNAMES, Filter(LAB_NAMES, StartsWith(LAB NAME',Dropdown2.Selected.'LAB NAME')));

TextInput1.Text = colLABNAMES.LAB_x0020_OWNER

Helpful resources

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (1,882)