I'm trying to dynamically add text to some of my TextInput fields on my form and I'm not having any success. The issue I keep running into is the "Incompatible types for comparison" error. And really, I'm not trying to compare, I'm trying to set the text property of a form field.
I have a SharePoint list, LAB_NAMES and it contains the fields 'LAB NAME', which is a text field, and 'LAB OWNER' which is a person field (not all fields included for simplicity). I have a dropdown on the form that allows a user to select the lab name that they are interested in. When the user selects the lab name, I would like to create a variable or collection that contains the other fields in the record, for example: LAB NAME, LAB OWNER, LAB POC, etc...
I tried to create the collection via the OnSelect method of the dropdown:
Collect(colLABNAMES, Filter(LAB_NAMES, StartsWith('LAB NAME',Dropdown2.Selected.'LAB NAME')));
I believe that colLABNAMES collection should contain all the fields after the user selects a lab name.
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
So, when I submit the form, TextInput1.Text should contain the owner's name and that will be submitted to the SharePoint list.