Forum Discussion
Filtering files using a SQL view or table
- 7 months ago
you already have everything that you need in the lookup. The simplest approach would be:
Lookup gets rows: (prefix, month_end_yyyymmdd)
Get-metadata gets all filenames (childItems)
Filter activity keeps only files where:
filename startswith(prefix) AND filename contains(month_end)
In Fabric pipelines the filter condition looks like this:
And(
startswith(item().name, item().prefix),
contains(item().name, item().month_end_yyyymmdd)
)If your lookup returns an array of objects, wrap the filter under a ForEach on the lookup output, but do NOT do multiple Get Metadata calls:
1 Get Metadata
1 ForEach over lookup records
Inside: Filter on the same childItems list
This prevents repeated enumeration of the folder. You generate a single list of files and apply logical filtering per prefix/date combination.
Hi pmscorca
Following up to confirm if the earlier responses addressed your query. If not, please share your questions and we’ll assist further.
Ok, about this issue I think that the For each should be sequential, isn't it?
Thanks
- v-aatheeque6 months agoCommunity Support
Hi pmscorca
Yes, ForEach is the right approach here. You will use ForEach to loop through each SQL row.Thank You.
- v-aatheeque6 months agoCommunity Support
Hi pmscorca
We wanted to follow up to check if you’ve had an opportunity to review the previous responses. If you require further assistance, please don’t hesitate to let us know.