Generate a JSON value

How do I generate a JSON value like below

{
“id”:1,
“name”: {
“full_name” : “Kees, Yanaton”, // Mockaroo generated value using function/formula
“first_name” : “Yanaton”, // Mockaroo generated value using function/formula
“last_name”:“Kees” // Mockaroo generated value using function/formula
}
}

Thanks!

You need to identify the name elements as being within the array by preceding the field name with the array name and dot(.):

  • name.first_name
  • name.last_name
  • name.full_name

then set full name as a ‘Template’ field type and create the combined string:
{last_name}, {first_name}
See example: https://www.mockaroo.com/2502ed30

If they must be in the order you have in the question, then you need to first create the first name and last name as hidden fields (precede with two underscores (__):

  • name.__first_name
  • name.__last_name

Then return all three fields as template fields.

Thank you for giving an example I used it to come up with the JSON structure I needed - the value of the field has to be an object NOT an array of objects.