我想从逻辑应用程序发送JSON到Azure ServiceBus,但我正在努力正确的格式(我认为)。逻辑应用程序从SharePoint Online列表项获取信息,以便我可以在逻辑应用程序中将其作为动态内容进行访问。对于这个帖子,假设JSON模板看起来是这样的:Azure逻辑应用程序发送JSON消息到ServiceBus
{ Title: '', CreatedBy:'' }
现在在逻辑应用程序设计师,我将内容类型设置为“text/plain的”,以确保编码处理(如描述here),然后将上面的模板添加到“内容”字段。它看起来像这样的逻辑应用程序设计(代码视图),这是我所期待的:
"ContentData": "@{base64('{ Title: '', CreatedBy:'' }')}"
如果我回去的设计师和,单引号之间的“标题”,我从我的动态添加字段内容设计师(代码视图)看起来是这样的:
"ContentData": "@{base64(concat('{ Title: '',triggerBody()?['Title'],'', CreatedBy:'' }'))}"
当我试图挽救,我得到以下错误:
Failed to save logic app MyLogicApp. The template validation failed: 'The template action 'Send_message' at line '1' and column '163728' is not valid: "Unable to parse template language expression 'base64(concat('{ Title: '',triggerBody()?['Title'],'', CreatedBy:'' }'))': expected token 'RightParenthesis' and actual 'Identifier'.".'.
我觉得错误告诉我这个问题,但我可以真不明白。有人可以帮我用正确的格式吗?
从我挂到上面的文章,我也试过,但得到了同样的错误:
"ContentData": "@{base64(concat('{ Title: '', string(triggerBody()?['Title']),'', CreatedBy:'' }'))}"
编辑:我忘了补充一点,我发现,推荐加入decodeBase64 this article用JSON和逻辑工作时应用。不确定它是否相关,因为我没有从ServiceBus解析。