admin管理员组

文章数量:1294324

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

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

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/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?

Share edited Feb 14 at 6:00 RithwikBojja 11.4k2 gold badges5 silver badges15 bronze badges Recognized by Microsoft Azure Collective asked Feb 12 at 13:03 ww-samww-sam 11 bronze badge 2
  • Did you try to change it? – RithwikBojja Commented Feb 13 at 3:35
  • Please provide enough code so others can better understand or reproduce the problem. – Community Bot Commented Feb 14 at 0:30
Add a comment  | 

1 Answer 1

Reset to default 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:

Change it to:

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

Output:

本文标签: functionLogic App Boolean Expression True not trueStack Overflow