Random name {|}

Hi there,

How can I make a random word/name in this format {HI|dear|hello}

Want to made into input

Hi

You must use split function wirh random choice

this is the code

{
  "Name": "Split_Function",
  "CreationDate": "2019-12-4",
  "Commands": [
    {
      "Command": "store",
      "Target": "11111-22222",
      "Value": "Col"
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return ${Col}.split(\"-\")[0].trim();",
      "Value": "First_Part"
    },
    {
      "Command": "echo",
      "Target": "${First_Part}",
      "Value": ""
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return ${Col}.split(\"-\")[1].trim();",
      "Value": "Second_Part"
    },
    {
      "Command": "echo",
      "Target": "${Second_Part}",
      "Value": ""
    }
  ]
}

Replace [0] and [1] with a random number to grab a random value

Change split("-") with split("|")

@newuserkantu Nice JS work!

1 Like