gpt4 book ai didi

azure - 如何避免在追加字符串连接器逻辑应用程序中添加重复字符串

转载 作者:行者123 更新时间:2023-12-03 21:18:53 25 4
gpt4 key购买 nike

我有以下 json 数组输入 -

"results": [
{ "tableName" : "ABC","id":"11"},
{ "tableName" : "ZX","id":"11"},
{ "tableName" : "ABC","id":"11"}
]}

在逻辑应用程序中,我在 For_each 中使用了 `` 我能够成功附加字符串,但如何避免添加已经存在的字符串?就像上面的例子我当前的输出是 -ABC,ZX,ABC我想要 - ABC,ZX enter image description here

最佳答案

可以用Array来实现,有union函数返回一个包含指定集合中所有项目的集合。它将返回一个没有重复字符串的集合。然后使用 join 操作返回字符串。

enter image description here

因为union函数必须至少包含两个集合,所以我使用了两个相同的集合。表达式如下:union(variables('tablename'),variables('tablename'))

下面是结果。

enter image description here

enter image description here

希望这可以帮助你。

关于azure - 如何避免在追加字符串连接器逻辑应用程序中添加重复字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56885683/

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