cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Project Oakdale - Filter combo box records based on their choice value

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:

Tristan_Falcon_1-1601435078179.png

Not sure if my filter is wrong or if Project Oakdale has a bug?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

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

View solution in original post

4 REPLIES 4
Community Support
Community Support

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

View solution in original post

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

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (5,769)