Hello @Jay and welcome to Microsoft Q&A.
The solution you came up with using the length()
is the fastest and simplest way.
However the expression itself could be refined.
@greater( length(activity('GetFileNames').output.childItems), 0)
I wrote that freehand, so please let me know if I made a mistake. This compares whether the length of the childItems array is greater than 0. It should return true if greater than 0, false otherwise. We do not need to use the if
and equals(2,3)
because the greater function returns a true/false just like equals()
does.
In the case of no files, childItems is []
. []
is the empty array, an array with 0 items, so length([]) should return 0.
Let me know if this helps.