cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Getting Lookup Column Value using Lookup Function

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)

IDName (Text field)Category (Text field)
   
   
   


ListB (FacilityManagement)

IDTitle (Text field)Category (Lookup)
1JacksonTexas
2FordBanners
3MemorialOthers

 

ListC (Category)

IDTitle (Text Field)
1Texas
2Banners
3Others

 

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.

 

image.png

 

 

 

 

 

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

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

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

Best Regards,
Qi

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

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.

 

v-qiaqi-msft
Community Support
Community Support

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

Best Regards,
Qi

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.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,190)