0

In Power Automate I have a Filter array data operation which retrieves the following JSON Input:

[
  {
    "id": "123",
    "email": "[email protected]",
    "mobilePhone": "",
    "countryCode": "TR",
    "preferences": {
      "acceptsEmail": "true"
    }
  },
  {
    "id": "1234",
    "email": "[email protected]",
    "mobilePhone": "",
    "countryCode": "BE",
    "preferences": {
      "acceptsEmail": "false"
    }
  }
]

Notice that the value of the acceptsEmail key is a "true" or "false" string and not a boolean.

Im trying to do the following to filter out all occurences of "preferences": { "acceptsEmail": "false" }

In the filter query i use item()?['preferences']?['acceptsEmail'] in the first field, is equal to in the second field, and false in the third field. When I run the flow the output body is empty and I cant seem to understand why, but im guessing its due to the string values of "true"/"false" not being found by my query.

1
  • 1
    Update/edit your question to include the Code Peek for that action. In the meantime, for the third field, enter 'false' as an Expression to ensure it is set as a string. Commented Feb 19 at 14:24

1 Answer 1

2

update the third field as expression string('false') to convert it as a string and be able to filter properly

enter image description here

output: enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.