![](/img/trans.png)
[英]Azure Logic App not able create client certificate authentication with converted base64 encoded pfx
[英]Parsing JSON array in Azure Logic App from base64 encoded string to use in For_each
我正在嘗試遍歷一個JSON
數組,該數組已被編碼為一個字符串,以便存儲在隊列中。 但是,我收到以下錯誤消息:
{"code":"ExpressionEvaluationFailed","message":"模板操作 'For_each' 的執行失敗:'foreach' 的評估結果 '[{\"Foo\":\"Bar\"}]'動作表達式 '@{json(decodeBase64(triggerBody()['ContentData']))}' 不是有效數組。"}
以下是正在解析的字符串: [{"Foo":"Bar"}]
當JSON
字符串不在數組中時,我可以毫無問題地解析它,例如: {"Foo":"Bar"}
當我不使用For_each
時,這解析得很好。
如何讓邏輯應用程序將其作為數組讀取?
這里的問題是您正在使用字符串插值(其中表達式包含在 @{ ... } 中),其計算結果為數組的字符串表示。 因此,'foreach' 表達式的計算失敗。
您希望表達式為@json(decodeBase64(triggerBody()['ContentData']))
json(decodeBase64(body('HTTP')?['$Content']))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.