0

I have a Logic App expression that evaluates the condition correctly, but outputs True instead of true.

A subsequent POST HTTP action fails as the JSON payload that contains this value cannot parse True and requires true.

Key-value pair containing the expression:

"apiTicket": @{equals(body('Get_Ticket_Details')?['takenby'], 'Integration Agent')}

Runtime output:

"apiTicket": True

Error:

{
  "error": {
    "code": "InvalidRequestContent",
    "message": "The request content is not valid and could not be deserialized: 'Unexpected character encountered while parsing value: T. Path 'params.apiTicket', line 15, position 17.'."
  }
}

Microsoft reference guide states the equals function should return true or false, not True or False

https://learn.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#equals

I understand how to work around this error, but does anyone know why this function works like this?

2
  • Did you try to change it? Commented Feb 13 at 3:35
  • Please provide enough code so others can better understand or reproduce the problem. Commented Feb 14 at 0:30

1 Answer 1

0

Logic App equals() function gives True and False as the answer and not as true or false.

To overcome this you can simply you tolower() function as below:

Here, I have taken manually as True for apiTicket. You can use it dynamic value:

enter image description here

Change it to:

"apiTicket": tolower(equals(body('Get_Ticket_Details')?['takenby'], 'Integration Agent'))

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.