Share via

Valid JSON Expression fails...why?

Johns-305 16 Reputation points
2022-12-26T20:19:17.237+00:00

@{triggerBody()[BatchedItems][?(@.messageId='6d2fba44-518c-42f3-befc-9ca61b08d65d')][content][$content]}

fails to validate with:

Unable to parse template language expression 'triggerBody()[BatchedItems][?(@.messageId='6d2fba44-518c-42f3-befc-9ca61b08d65d')][content][$content]': expected token 'LeftParenthesis' and actual 'RightSquareBracket'.".'.

The body is the Batched Items content. This is a valid expression, other JSON test tools recognize it, why doesn't Logic Apps recognize it?

The error message is beyond useless. As opposed to the fake Square Bracket? Do better.

Azure Logic Apps
Azure Logic Apps

An Azure service that automates the access and use of data across clouds without writing code.


1 answer

Sort by: Most helpful
  1. Johns-305 16 Reputation points
    2022-12-28T17:31:39.99+00:00

    Then I think it would be easier to convert to Xml and use xPath.

    It would be nice if JSONPath worked as expected.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.