简体   繁体   English

该名称不能包含以下任何符号:'[, ], .'.'。 用于在 Azure 逻辑应用程序中撰写

[英]The name cannot contain any of the following symbols: '[, ], .'.'. for Compose in Azure Logic App

I have below JSON which I need to update inside a logic app我有以下 JSON,我需要在逻辑应用程序中更新

{
  "name": "SampleDoc",
  "type": "123",
  "properties": {
    "GP.Test": "M1",
    "MG.Test": "C1"
  }
}

在此处输入图片说明

I have used following setProperty syntax: -我使用了以下 setProperty 语法:-

@setProperty(variables('ResponseBody'),'properties', setProperty(variables('ResponseBody')['properties'], 'test','abc'),
setProperty(variables('ResponseBody')['properties'], 'GP.Test','M2'))

My desired JSON output should be我想要的 JSON 输出应该是

{
  "name": "SampleDoc",
  "type": "123",
  "properties": {
    "GP.Test": "M2",
    "MG.Test": "C1"
  }
}

But when I am running this, I am getting this error: -但是当我运行这个时,我收到这个错误:-

InvalidTemplate.无效模板。 Unable to process template language expressions in action 'Compose' inputs at line '1' and column '2617': 'The provided property name 'GP.Test' has these invalid characters '.'.无法在“1”行和“2617”列的“撰写”操作中处理模板语言表达式:“提供的属性名称“GP.Test”具有这些无效字符“.”。 The name cannot contain any of the following symbols: '[, ], .'.'.该名称不能包含以下任何符号:'[, ], .'.'。

Could anyone suggest if we can handle '.'任何人都可以建议我们是否可以处理“。” inside compose or any other way for achieving this?内部撰写或任何其他方式来实现这一目标?

Yes that is correct behavior that is occurring in the logic apps.是的,这是逻辑应用程序中发生的正确行为。 The reason is that you have used the set property function to set the value of the GP.Test property.原因是您使用了 set 属性函数来设置 GP.Test 属性的值。 When working with the expressions in logic apps, the '.'在逻辑应用程序中使用表达式时,“.” operator is reserved operator and will be used to access sub properties etc of the expressions, functions etc. Hence you get the error.运算符是保留运算符,将用于访问表达式、函数等的子属性等。因此您会收到错误消息。 The solution to this is actually simple, you use the compose action directly without using the set property.解决这个问题的方法其实很简单,直接使用 compose 动作,不使用 set 属性。 Sample screenshot below.下面的示例屏幕截图。 在此处输入图片说明

Or if you want complex transformations, then using the liquid transformations through the integration account is the way to go或者,如果您想要复杂的转换,那么通过集成帐户使用流动转换是要走的路

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM