I'm working on a Canvas App to track client interactions and contacts, and my main data sources are Dataverse tables. My home screen has a gallery on it that shows all the meetings from all clients, and I want to be able to filter this gallery by client name. The issue I'm having is that no matter how I try it, I can't reference the field anywhere in the gallery associated with the client/project name. I'm thinking it may be because that field is a Lookup field in my Dataverse table, but I'm not sure how to circumvent that.
Is there a way within my canvas app gallery to reference that field? Or have I set up that field incorrectly?
Hi @gnorman ,
Yes this is possible with either a Combo Box control or a Dropdown control.
For example, in the Items property of the Dropdown or Combo Box control, use:
Sort(
Ungroup(
Table(
{
DropdownOptions: Distinct(
'Your Data',
'Your Field'
)
},
{DropdownOptions: ["#All"]}
),
"DropdownOptions"
),
Value
)
In the Items property of your Gallery, use:
Filter(
'Your Data',
//Dropdown1.SelectedText.Value = "#All" || 'Your Field' = Dropdown1.SelectedText.Value //use for a dropdown control
ComboBox1.Selected.Value = "#All" || 'Your Field' = ComboBox1.Selected.Value //use for a combo box control
)
Given there are multiple Solutions to different questions in this thread, please mark them as Solved if they answered your questions. Remember, you can accept more than one post as a solution.
If you like my response, please give it a Thumbs Up.
This worked, thank you. I have one additional question: Is there any way you know of to create an "all" option for a drop-down control? I know with a combo box I can just add all the members of a particular field, but if I have 100 clients that could get tedious. I tried using an If equation in conjunction with the Filter function, but I couldn't figure out how to add "all" or something simliar to the drop-down.
To Filter a Gallery using a related Dataverse column on a many-to-one relationship:
1. Create either a Combo Box control or Dropdown control and set the Items property to the Client table.
2. Select the Field you want to see using the Combo Box properties pane and disable Allow multiple selections
3. For the Gallery, apply the following expression. Note the expression is the same for either a Dropdown control or a Combo Box control:
Filter(
Meetings,
'Project Name'.'Client Name' = Your_ComboBox.Selected.'Client Name'
)
------------------------------------------------------------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.
If you like my response, please give it a Thumbs Up.
Thank you, that worked for displaying the data within that field within the gallery.
Now, what I'm trying to figure out is how to use that field as a filter/search field within the gallery. I've tried using a dropdown control:
But I couldn't get the drop down to populate using the entries in that field.
So, I tried using a search box and a search equation within the gallery:
and this didn't work either. Now, in this one, when I was typing the equation, I was prompted to use the schema/logical name for the field:
Again, with any of the other fields from this table, this works but I'm struggling with the Project Name field.
Hi @gnorman ,
Add a period/full stop after 'Project Name' (your Lookup column) to return fields from the related table.
------------------------------------------------------------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.
If you like my response, please give it a Thumbs Up.