Forum Discussion
nicholas888
Jun 24, 2021Copper Contributor
Using an array with where statement
I am trying to pass an array to the where clause, please see example below: let terms = pack_array('12345', 'ABC123'); ADFPipelineRun | where ResourceId has_any (terms) I am aware I can use...
Evgeny Ternovsky
Microsoft
Jun 28, 2021nicholas888 - assuming you're looking to match full strings, you'll want to use the "in" operator to achieve this. To reuse your example, your query becomes:
let terms = pack_array('12345', 'ABC123');
ADFPipelineRun
| where ResourceId in (terms)
"has_any", as you have it, would be more the equivalent of Col contains 'term1' OR Col contains 'term2' OR [...]. "In" replaces the contains with ==s.
- nicholas888Jun 28, 2021Copper Contributor
Evgeny Ternovsky - we tried to match the resource name and not the whole string.
example:
we need a match 39515 only. So IN will not work.
Please advise.