I have a combo box, the data source is a table in Project Oakdale that holds buildings. I would like to filter the drop down to only show buildings that have a status(choice column) of "Available". I seem to get an error using the following:
Not sure if my filter is wrong or if Project Oakdale has a bug?
Solved! Go to Solution.
Hi @Tristan_Falcon :
In Project Oakdale, Choice belongs to a special data type (similar to Option in CDS entity). Usually this type of field can not be directly calculated.
I have three methods for your reference.
Solution1:Refers to the value of'Status' in a record in the table(Do this to ensure that the data types are the same)
For example:
Filter(LeaseBuildings,'Status (cr3db_status)'=First([@LeaseBuildings]).'Status (cr3db_status)')
Solution2:Using Choices([@LeaseBuildings].'Status (cr3db_status)')
For example
Filter(LeaseBuildings,'Status (cr3db_status)'=First(Choices([@LeaseBuildings].'Status (cr3db_status)')).Value)
The fatal disadvantage of these two solutions is the lack of flexibility. You need to pre-determine that the status of the record/option you use as the filter criteria is ‘Available’.
Solution3:Using a combo box control
1\Add a combo box control(Microsoft_CoreControls_ComboBox1) and set it's items property to
Choices(LeaseBuildings.'Status (cr3db_status)')
2\Try this code:
Filter(LeaseBuildings,'Status (cr3db_status)'=Microsoft_CoreControls_ComboBox1.Selected.Value)
Best Regards,
Bof
Hi @Tristan_Falcon :
In Project Oakdale, Choice belongs to a special data type (similar to Option in CDS entity). Usually this type of field can not be directly calculated.
I have three methods for your reference.
Solution1:Refers to the value of'Status' in a record in the table(Do this to ensure that the data types are the same)
For example:
Filter(LeaseBuildings,'Status (cr3db_status)'=First([@LeaseBuildings]).'Status (cr3db_status)')
Solution2:Using Choices([@LeaseBuildings].'Status (cr3db_status)')
For example
Filter(LeaseBuildings,'Status (cr3db_status)'=First(Choices([@LeaseBuildings].'Status (cr3db_status)')).Value)
The fatal disadvantage of these two solutions is the lack of flexibility. You need to pre-determine that the status of the record/option you use as the filter criteria is ‘Available’.
Solution3:Using a combo box control
1\Add a combo box control(Microsoft_CoreControls_ComboBox1) and set it's items property to
Choices(LeaseBuildings.'Status (cr3db_status)')
2\Try this code:
Filter(LeaseBuildings,'Status (cr3db_status)'=Microsoft_CoreControls_ComboBox1.Selected.Value)
Best Regards,
Bof
Thanks @v-bofeng-msft I'll keep these options in mind.
I ended up creating a custom view on the LeaseBuilding entity that has the necessary filter.
Hi @Tristan_Falcon :
Is there anything else I can help?
If my post helps, then please consider Accept it as the solution to help others.Thanks.
Best Regards,
Bof
Hey there, just accepted the solution.
Sorry, still a bit new around here... haha
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
197 | |
174 | |
62 | |
33 | |
32 |
User | Count |
---|---|
340 | |
270 | |
109 | |
72 | |
58 |