gpt4 book ai didi

azure - 无法为变量设置值,它始终在逻辑应用程序中采用初始值

转载 作者:行者123 更新时间:2023-12-02 07:46:49 24 4
gpt4 key购买 nike

我有一个变量,我将默认值设置为 0。

在 for_each 中,我为 startIndex 变量设置新值,并在 For_each 中使用该变量,但它仍然使用旧的 0 值。

逻辑应用代码 -

{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"For_each_2": {
"actions": {
"Set_variable_3": {
"inputs": {
"name": "output",
"value": "@{split(items('For_each_2'),':')[0]}:@{substring(variables('mydata'),variables('startindex'),int(split(items('For_each_2'),':')[1]))}"
},
"runAfter": {},
"type": "SetVariable"
},
"Set_variable_4": {
"inputs": {
"name": "startIndex",
"value": "@int(split(items('For_each_2'),':')[1])"
},
"runAfter": {
"Set_variable_3": [
"Succeeded"
]
},
"type": "SetVariable"
}
},
"foreach": "@variables('splitvar')",
"runAfter": {
"Initialize_variable_9": [
"Succeeded"
]
},
"type": "Foreach"
},
"Initialize_variable_5": {
"inputs": {
"variables": [
{
"name": "mydata",
"type": "String",
"value": "abcdefg"
}
]
},
"runAfter": {},
"type": "InitializeVariable"
},
"Initialize_variable_6": {
"inputs": {
"variables": [
{
"name": "key",
"type": "String",
"value": "AA:3;BB:2"
}
]
},
"runAfter": {
"Initialize_variable_5": [
"Succeeded"
]
},
"type": "InitializeVariable"
},
"Initialize_variable_7": {
"inputs": {
"variables": [
{
"name": "splitvar",
"type": "Array",
"value": "@split(variables('key'),';')"
}
]
},
"runAfter": {
"Initialize_variable_6": [
"Succeeded"
]
},
"type": "InitializeVariable"
},
"Initialize_variable_8": {
"inputs": {
"variables": [
{
"name": "output",
"type": "String"
}
]
},
"runAfter": {
"Initialize_variable_7": [
"Succeeded"
]
},
"type": "InitializeVariable"
},
"Initialize_variable_9": {
"inputs": {
"variables": [
{
"name": "startIndex",
"type": "Integer",
"value": 0
}
]
},
"runAfter": {
"Initialize_variable_8": [
"Succeeded"
]
},
"type": "InitializeVariable"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {},
"triggers": {
"manual": {
"inputs": {
"schema": {}
},
"kind": "Http",
"type": "Request"
}
}
}
}

最佳答案

您需要对每个操作启用并发控制。默认情况下,每个操作的并行度设置为 20。因此,作为默认行为,它会并行运行该操作 20 次。将其调低至 1。

Settings[1]

Degree of Parallelism ] 2

关于azure - 无法为变量设置值,它始终在逻辑应用程序中采用初始值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56770437/

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