Introduction
Recently, I was having trouble filtering out the values from an array based on a year. When trying to configure the array as per the screenshot below, I am getting an empty array returned at the end. Below is the screen capture for reference.
Below is the screen capture of the array object.
When using the filter array with the below configuration, it gives the empty array.
Reason
The reason why we are getting the empty array is that the object defined in the array is a type of string. The value 2024 is defined in quotes in the array.
Fix
It is required to convert the 2024 to string using Power Automate expressions and then use the Filter Array option. Below is the correct way of filtering the arrays of type string. We need to get the equivalent string value of 2024.
Below is the screen capture of the correct configuration.
Result
Below is the result of the Filter Array.
Conclusion
Thus, in this article, we have seen how to filter out an array in a special case where the year value is defined as a string.