gpt4 book ai didi

azure - 如何使用逻辑应用程序tolower()函数

转载 作者:行者123 更新时间:2023-12-02 23:19:14 24 4
gpt4 key购买 nike

使用下面的代码作为示例(会有更多结果),我正在构建一个 if true/false 语句,该语句将输入为大写或小写。我不确定如何利用 tolower() 函数来强制语句的输入始终为小写。

[
{
"VM": "MyVM1",
"Success": true,
"PSComputerName": "localhost",
"PSShowComputerName": true,
"PSSourceJobInstanceId": "5e18cd92-5676-4ed6-a7e4-14b0d9fea3b3"
},
{
"VM": "MyVM2",
"Success": true,
"PSComputerName": "localhost",
"PSShowComputerName": true,
"PSSourceJobInstanceId": "5e18cd92-5676-4ed6-a7e4-14b0d9fea3b3"
}
]

我的逻辑应用流程: enter image description here

我首选的逻辑应用流程更改: flow

如您所见,我尝试使用以下条件:

@contains(tolower(items('For_each')['VM'], 'myvm1'))

但是,当逻辑应用运行时,我会看到以下错误输出:

InvalidTemplate. Unable to process template language expressions for action 'Condition' at line '1' and column '2179': 'The template language function 'tolower' expects one parameter: the string to convert to lower casing. The function was invoked with '2' parameters. Please see https://aka.ms/logicexpressions#toLower for usage details.'.

https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

我已经查看了文档,但遗憾的是我对它的理解不够,不知道如何编辑此查询。任何帮助将不胜感激

最佳答案

所以...错误是正确的。您当前的表情

@contains(tolower(items('For_each')['VM'], 'myvm1'))

正在向 tolower() 传递两个参数

@contains(tolower(items('For_each')['VM'], 'myvm1'))

items('For_each')['VM'] --and-- 'myvm1'

也许你真的想要

@contains(tolower(items('For_each')['VM']), 'myvm1')

关于azure - 如何使用逻辑应用程序tolower()函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49035447/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com