web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filtering Combo Box Ch...
Power Apps
Unanswered

Filtering Combo Box Choices based on Lookup Columns in Multiple Dataverse Tables

(1) ShareShare
ReportReport
Posted on by 67
Hello everyone,
 
Recently I was tasked with converting a Power App built on SharePoint Lists to Dataverse Tables. Since Dataverse handles data differently than SharePoint Lists, there's been a lot of rewriting code for the various Data Cards in the App. I was able to rewrite most of it, but there is one formula I can't figure out.
 
Initially I had 3 SharePoint lists, 'Countries', 'Tasks', and 'Activities':
  1. 'Countries': the title column was populated with countries.
  2. 'Tasks': the title column was populated with tasks, and there was a lookup column called 'Country' that looked up country values from the 'Countries' list.
  3. 'Activities': the title column was populated with activities, and there was a lookup column called 'Country' that looked up country values from the 'Countries' list and another lookup column called 'Task' that looked up task values from the 'Tasks' list.
  4. Each country had different tasks in list 2, and thus had different activities.
In my Power App, I had a Combo Box on the home screen called 'CountryComboBox' that was tied to the 'Countries' list. You would select a country to see the tasks and activities for that country in the subsequent screens. One of these screens had an edit form so users could submit activities to the activity list. This form had a Combo Box for tasks, and I filtered the choices for this to only show tasks for the selected country, with the following code set to the Items property of the combo box:
 
Filter(
    Choices([@'Activities'].Task),
    Not(
        IsEmpty(
            Filter(
                'Tasks',
                Country.Value = CountryComboBox.Selected.Title && Task.Value = Value
            )
        )
    )
)

I’ve migrated the data from the SharePoint Lists to Dataverse tables, with the same hierarchy/relationships. Now I’m trying to convert this formula to use the new Dataverse tables, but am having a lot of trouble getting it to work. I’ve tried:
 
Filter(
    Choices([@'Activities'].Task),
    Not(
        IsEmpty(
            Filter(
                [@'Tasks'],
                Task.Task = Task.Task && Country.Country = CountryComboBox.Selected.Country
            )
        )
    )
)
 
but this gives me the “We didn’t find any data” error message.
 
I’ve also tried:
 
Filter(
    Choices([@'Activities'].Task),
    Task in Filter(
        [@'Tasks'],
        CountryComboBox.Selected.Country = Country.Country
    ).Task
)
 
but this gives a “Can’t convert this data type. Power Apps can’t convert this Text to a Record” error on the Task in the "Task in Filter..." part.
 
To summarize, I'm trying to filter a combo box to only show task values for the selected country with Dataverse tables as the data source, but have been unable to figure out how to accomplish this for the past few days.
 
I would greatly appreciate any help any of you can provide on this matter. Thank you in advance!
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,315 Super User 2025 Season 2 on at
    Hi
     
    I will come back with more information
     
    But can you try changing Task In to Task.Value please


    I want to add that most people that are new to the Dataverse side will use Choices for actually is a mapping table.

    I do not recommend it. Its easier to have a Table with all the items in it as strings than it is to make them choices.
    Reason 1: If i want to update a drop down with choices, I need to do an entire deployment.
    If i just use a string. i update the table with the new row and bingo it appears

    Reason 2: dont even get me started on Multi-Select options.. they are the BANE of Power Apps.

    Reason 3: Choices are overkill

    I have more.. just in a hurry.
  • RH-13081816-0 Profile Picture
    67 on at
    Hey @FLMike,
     
    Thank you for the suggestion. Adding .Value gives another error: "the '.' operator cannot be used on text values."
     
    I think the problem is that the Task in the "Task in Filter" is a Lookup column so that's why the code keeps throwing errors. I have other combo box's with code similar to that, except the "_____ in Filter..." column is a text column and it works.
     
    Luckily this combo box is single-select at least.
     
    Looking forward to your other suggestions!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard