I don't understand why one of my formulas is not working. I get the error "Specified cast is not valid". (see attached screenshot)
Items: Filter('Employment term (mshr)', Employment.'Employment (mshr)' = DropEmployments.Selected.'Employment (mshr)',ValidTo <= Today())
I use a Dropdown (source virtual entity "Employment (mshr)") and depending on this dropdown the gallery should show all associated "Employment terms" that have the ValidTo date greater or equal Today. Without the "ValidTo <= Today()" part the formula works as expected.
Maybe somebody has a hint...
The error seems to indicate that 'Employment term (mshr)' is not a valid datasource or the field chosen in the equation doesn't exist in the datasource. The second part of the filter (the equation part) should be a field in the datasource.
Filter( 'Employment term (mshr)', 'Employment (mshr)' = DropEmployments.Selected.'Employment(mshr)', ValidTo <= Today() )
I'm not sure that the "Employment." is necessary if 'Employment (mshr)' is an actual field in 'Employment term (mshr)'.
thanks for your answer, you are right, I have changed the formula as below. This way its clearer.
Filter( 'Employment term (mshr)', 'Primary Field' = DropEmployments.Selected.'Primary Field',ValidTo >= Today() )
But still I get the same error... When I remove the "ValidTo >= Today()" filter it works, but I need this filter to show only the new employments
Now I get only the "Filter Warning for big data sets". Unfortunately the Gallery in the PowerApp is always empty, checked on 5-6 different cases. 😞
It looks like you are using Dataverse. If so, create a new column, give it a name and make it a calculated type.
In the formula for the calculation, put DIFFINDAYS(NOW(),ValidTo) and save it. Open Views, ActiveView and add the new column and see if there is data in it.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.