2017-10-17 106 views
0

我有一个逻辑应用程序实例与载解析的JSON逻辑应用程序中的变量替换表达式

我想使用的值设置id以RESTful API集合资源的
      "Set_PO_Key_variable_": { 
          "inputs": { 
           "name": "AddedPoKey", 
           "value": "@{body('Parse_JSON')?['poKey']}" 
          }, 
          "runAfter": { 
           "Parse_JSON": [ 
            "Succeeded" 
           ] 
          }, 
          "type": "SetVariable" 
         }, 

变量AddedPoKey。尽管我确信它应该这样做,但我一直无法实现。我可能没有找到最好的MS文档,如果有任何可以指出,我将不胜感激。我曾尝试过:

      "Set_Po_Lin_Add_url_": { 
          "inputs": { 
           "name": "CreatePoLineResourceUrl", 
           "value": "@{replace('https://api.plex.com/EDI/sales-orders/{PoKey}/lines','{PoKey}',triggerBody()['AddedPoKey'])}" 
          }, 
          "runAfter": { 
           "Set_PO_Key_variable_": [ 
            "Succeeded" 
           ] 
          }, 
          "type": "SetVariable" 
         } 

这导致InvalidTemplate。无法在行'Set_Po_Lin_Add_url_'输入中在行'1'和列'2459'中处理模板语言表达式:'模板语言表达式'替换('https://api.plex.com/EDI/sales-orders/ {PoKey}/lines','{PoKey}',triggerBody()[ 'AddedPoKey'])'不能被评估,因为属性'AddedPoKey'不存在,可用属性是'ContentData,ContentType,ContentTransferEncoding,Properties,MessageId,To,ReplyTo,ReplyToSessionId,Label,ScheduledEnqueueTimeUtc,SessionId,CorrelationId,SequenceNumber,LockToken ,TimeToLive'。请参阅https://aka.ms/logicexpressions了解使用细节。'。

回答

0

然后

"@{replace('https://api.plex.com/EDI/sales-orders/{PoKey}/lines','{PoKey}',variables('AddedPoKey')}" 

工作

请注意https://aka.ms/logicexpressions是我的主要参考资料,但此时页面上甚至没有“变量”一词。

+0

您是否在代码视图中编写了该代码?您是否尝试过在设计器中使用表达式编辑器,这将允许您在构建表达式时选择变量和标记。 –

+0

以我的经验,使用Edge和Firefox,表达式编辑器和设计师在条件的第三次嵌套时陷入困境。这促使我进入代码视图。 –