4

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 enter image description here

Joy Wang
  • 39,905
  • 3
  • 30
  • 54
Neo
  • 15,491
  • 59
  • 215
  • 405

1 Answers1

6

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.

enter image description here

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.

enter image description here

enter image description here

Hope this could help you.

George Chen
  • 13,703
  • 2
  • 11
  • 26