How to avoid to add duplicate string in append string connector logic app

元气小坏坏 提交于 2019-12-08 04:53:07

问题


I have following json array input -

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

In logic app i have used `` in For_each I'm able to append string successfuly but how to avoid adding already present string ? like above example my current output is - ABC,ZX,ABC i want - ABC,ZX


回答1:


You could use the Array to implement, there is a union function to return a collection that has all the items from the specified collections. It will return a collection without duplicate string. Then use join action to return the string.

Cause the union function must contain two collection at least, so I used two same collections. The expression is like this: union(variables('tablename'),variables('tablename'))

The below is the result.

Hope this could help you.



来源:https://stackoverflow.com/questions/56885683/how-to-avoid-to-add-duplicate-string-in-append-string-connector-logic-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!