Hello Everyone,
I am new to powerApps, and I am having issue with Powerapps Lookup function.
I have Three SharePoint List: ListA, ListB, ListC.
App is created on ListA. ListC act as a lookup in ListB
ListA (Facility)
ID | Name (Text field) | Category (Text field) |
ListB (FacilityManagement)
ID | Title (Text field) | Category (Lookup) |
1 | Jackson | Texas |
2 | Ford | Banners |
3 | Memorial | Others |
ListC (Category)
ID | Title (Text Field) |
1 | Texas |
2 | Banners |
3 | Others |
In App, Name field act as dropdown and it is connected to ListB title field. So when user open dropdown it get all data from ListB title column. No issues so far.
Requirement is when user select value from dropdown, I should get its relevant Category and store in Category text field in ListA.
Ex: if User selects Ford from dropdown, I should get Banners and assign to Category text field.
I tried below formula:
Set(varCategory,LookUp('ListB',Title=ddl_Name.SelectedText.Value).'Category:Title'.Value)
when I inspect variable value.. it shows it have table data instead of text.
I appreciate if anyone can points out my mistake or if there is another way to get lookup column value, it will be a big help.
Thanks
Solved! Go to Solution.
Hi@salahbin,
Could you please tell me that how you set the Items property of the your drop down control?
Do you want to populate the Category in ListA based on the drop down control selected?
In my scenario, I have a totally same data set as yours.
Here is how I set the drop down:
ListB.Title
Set the Default property of the TextInput corresponding to the Category text field in ListA as below:
LookUp(ListB,Title=Dropdown1.Selected.Title,Category).Value
If you want to save the assigned value to the Category text field in ListA, please set the OnSelect property of a button:
Patch(
ListA,
LookUp(
ListA,
ID = 1
),
{
Name: Dropdown1.Selected.Title,
Category: LookUp(
ListB,
Title = Dropdown1.Selected.Title,
Category
).Value
}
)
Regards,
Qi
Hi @Anonymous ,
You cannot use Lookup columns in lookups or filters, not directly anyway. There is a method of getting the "primary" columns with AddColumns, however this is not Delegable. You are much better off simply doing the same lookup in Power Apps using the same lists. Please have a read of this blog of mine and ask yourself if you really need the lookup column.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi@salahbin,
Could you please tell me that how you set the Items property of the your drop down control?
Do you want to populate the Category in ListA based on the drop down control selected?
In my scenario, I have a totally same data set as yours.
Here is how I set the drop down:
ListB.Title
Set the Default property of the TextInput corresponding to the Category text field in ListA as below:
LookUp(ListB,Title=Dropdown1.Selected.Title,Category).Value
If you want to save the assigned value to the Category text field in ListA, please set the OnSelect property of a button:
Patch(
ListA,
LookUp(
ListA,
ID = 1
),
{
Name: Dropdown1.Selected.Title,
Category: LookUp(
ListB,
Title = Dropdown1.Selected.Title,
Category
).Value
}
)
Regards,
Qi