有没有更好的方法来处理逻辑应用程序中的 if else 条件?
Is there any better way to handle if else condition in logic app?
在逻辑应用程序中,我有一个 myarray 变量,其值为 ['1','2','3']
在 Foreach
连接器中,它会一次出现一个值,并希望检查它是哪个值,并根据该值将值设置为另一个变量。
在 c# 中它会像 -
foreach (item in myarray)
{
if (item == 1)
{
set variable_data = 1
}
else if (item == 2)
{
set variable_data = 2
}
else if (item == 3)
{
set variable_data = 3
}
在逻辑应用程序中我可以这样做 -
在逻辑应用程序中有没有更好的方法来做到这一点?
您可以使用 switch 操作来实现此要求。
在逻辑应用程序中,我有一个 myarray 变量,其值为 ['1','2','3']
在 Foreach
连接器中,它会一次出现一个值,并希望检查它是哪个值,并根据该值将值设置为另一个变量。
在 c# 中它会像 -
foreach (item in myarray)
{
if (item == 1)
{
set variable_data = 1
}
else if (item == 2)
{
set variable_data = 2
}
else if (item == 3)
{
set variable_data = 3
}
在逻辑应用程序中我可以这样做 -
在逻辑应用程序中有没有更好的方法来做到这一点?
您可以使用 switch 操作来实现此要求。