Skip to content

Filter Array throws error when using contains #1255

@gschultz125

Description

@gschultz125

Describe the Bug with repro steps

Filter Array works with "is equal to". This code works.

{

"type": "Query",

"inputs": {

"from": "@Body('Parse_JSON')",

"where": "@equals(item()?['value'],'DPI Decision Disapproved')"

},

"runAfter": {

"Parse_JSON": [

"Succeeded"

]

}

}

This code with contains

{

"type": "Query",

"inputs": {

"from": "@Body('Parse_JSON')",

"where": "@contains(item()?['value'],'DPI Decision Disapproved')"

},

"runAfter": {

"Parse_JSON": [

"Succeeded"

]

}

}

Throws the error

The execution of template action 'Filter_array_value_DPI_Decision_Contains' failed: The evaluation of 'query' action 'where' expression '@contains(item()?['value'],'DPI Decision Disapproved')' failed: 'The template language function 'contains' expects its first argument 'collection' to be a dictionary (object), an array or a string. The provided value is of type 'Null'.'.

What type of Logic App Is this happening in?

Consumption (Portal)

Which operating system are you using?

Windows

Are you using new designer or old designer

New Designer

Did you refer to the TSG before filing this issue? https://aka.ms/lauxtsg

Yes

Workflow JSON

{
  "type": "Query",
  "inputs": {
    "from": "@body('Parse_JSON')",
    "where": "@contains(item()?['value'],'DPI Decision Disapproved')"
  },
  "runAfter": {
    "Parse_JSON": [
      "Succeeded"
    ]
  }
}

Screenshots or Videos

No response

Browser

Edge

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions