Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
Dan Gorman edited this page Nov 29, 2018 · 2 revisions

The JOIN Function

Function Group: Text

JOIN joins arguments with a provided delimiter argument.

Syntax

JOIN(arg1, arg2, [arg3])

  • arg1 is the delimiter to use to join text
  • arg2 is a string or array of strings
  • arg3 is optional, and is another string or array of strings
  • JOIN can take an arbitrary number of optional arguments

Uses

Let's say we're given a response with a list of car manufacturers for a given part:

{  
   "data":{  
      "parts":{  
         "part_1":[  
            "Toyota",
            "Hyundai",
            "Kia",
            "Mercedes Benz"
         ],
         "part_2":[  
            "BMW",
            "Mercedes Benz",
            "Ford",
            "Tesla"
         ]
      }
   }
}

If we want to compile an easier to read version of the distributors for a given part, we can use JOIN: JOIN(", " data.parts.part_1)

This will return "Toyota, Hyundai, Kia, Mercedes Benz".

Other Examples

We can also add the third, optional argument, to combine multiple values or arrays, like this:

JOIN(", " data.parts.part_1, data.parts.part_2) => "Toyota, Hyundai, Kia, Mercedes Benz, BMW, Mercedes Benz, Ford, Tesla"

Clone this wiki locally