You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Logic App equals函数返回True而非true致JSON解析失败,求原因

Why does Logic Apps' equals() function output uppercase True/False instead of JSON-compliant lowercase true/false?

Problem Context

When using the equals() expression in a Logic Apps JSON payload:

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

The runtime outputs:

"apiTicket": True

This causes a deserialization error in downstream HTTP POST requests:

{
"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.'."
}
}

Per Microsoft's documentation, equals() should return lowercase true/false—here’s why this discrepancy happens:

  • String embedding triggers .NET-style serialization
    When you use the @{...} syntax to embed an expression directly into a JSON template string, the Logic Apps runtime treats the expression’s return value as a .NET type, then calls its native ToString() method for string substitution. .NET’s bool type outputs uppercase True/False by default, which doesn’t match JSON’s lowercase boolean requirement.

  • Context-dependent serialization behavior
    The equals() function itself does return a proper boolean value. If you use it directly in an action like "Compose" (not embedded in a string template), the runtime correctly serializes it to JSON’s lowercase true/false. The issue only arises when embedding the expression result into a pre-defined JSON string, where the runtime prioritizes .NET string formatting over JSON type compliance.

  • Underlying .NET framework dependency
    Logic Apps’ workflow language is built on .NET. In string substitution scenarios, the runtime doesn’t automatically convert .NET boolean types to JSON-compatible lowercase strings. This is a specific edge case in how expression results are handled when injected into string templates, rather than a bug in the equals() function itself.

内容的提问来源于stack exchange,提问作者ww-sam

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 11:52:36