So this post is out of pure frustration that this information seems to be really hard to find (for me anyway) for what seemed like a basic requirement. I wanted to load a Gallery of information in a Canvas App based on the status reason within the Common Data Service. This field is often used in model-driven apps, including Dynamics 365 so being able to filter on this is pretty necessary for companion Canvas based apps.
This post defined why comparing Status Reason and other option set values against string values is not a great thing to do and why you should be cautious, and that is mainly because of localisation. If your environment is deployed in other countries, the labels on option sets are displayed to the user in another language, so your comparing Status Reason = ‘Cats’ in a French deployment, you’re going to evaluate as false. (French for Cats is ‘Le Chat’).
So this is how you do it, without using string operators (cause you can’t do that anyway)
You need to filter on your main data source, in this case, ‘Courses’, Then use the basic field, in this case ‘Status Reason’ that we want to filter on, then you want to evaluate this against its comparative enum value, which we are ‘Active’ or ‘Inactive’). This way we are not evaluating enum to string, or string to enum, we are evaluating object (enum) to object (enum)
And that is IT. See pic below and copy it for your requirements!