You need to explicitly differentiate between the loop variables in the outer and inner scopes. Unfortunately, ADF Data Flow Expressions do not support renaming loop variables directly. However, you can work around this limitation by using intermediate variables or restructuring your logic.
- Use an intermediate variable to store the
#item
from thereduce
function. - Use a different variable name for the inner
contains
function.
reduce(
split($disallowedCharacters, ''),
false(),
#acc || contains(
split(fieldName, ''),
#itemFromReduce != #itemFromContain
),
#result
)
If you cannot rename the loop variables, you can use intermediate variables to store the values temporarily:
reduce(
split($disallowedCharacters, ''),
false(),
#acc || (
#tempItemFromReduce = #item,
contains(
split(fieldName, ''),
#tempItemFromReduce != #item
)
),
#result
)