How do I concatenate multiple JSON code blocks?

Hello all. I searched the community, but am not sure looping is the answer to my issue. Please advise if I’m wrong. I don’t want to waste anyone’s time.

My issue is this. I am importing customers into a platform and can only import one block of JSON at a time. When I concatenate two blocks of customer info, I get this error:

{
    "statusCode": 422,
    "type": "validationError",
    "message": "One or more elements is missing or invalid",
    "errors": [
        {
            "field": "",
            "message": "must be a object"
        }
    ]
}

As soon as I concatenate another block of the code (sample below), then I get this error. Not sure if this is something I doing wrong in POSTMAN or if the error is coming from the target vendor.
Here is the code block:

[
{
    "firstName": "John",
    "lastName": "Doe",
    "birthDate": "1900-01-01",
    "city": "Somewhere",
    "stateCode": "CA",
    "zipCode": "xxxxx",
    "countryCode": "US",
    "emailMarketingStatus": "Subscribed",
	"phones": [{
    "phone": "+1xxxxxxxxxx"
	}],
	"emails": [{
    "email": "somebody@gmail.com"
	}]
}, *********** This is where I concatenate. Individually they work fine.
  {
    "firstName": "Jane",
    "lastName": "Doe",
    "birthDate": "1900-01-01",
    "city": "Somewhere",
    "stateCode": "CA",
    "zipCode": "xxxxx",
    "countryCode": "US",
    "emailMarketingStatus": "Unsubscribed",
	"phones": [{
    "phone": "+1xxxxxxxxxx"
	}],
	"emails": [{
    "email": "xxxxxx@yahoo.com"
	}]
  }
  ]

All help is greatly appreciated.

Thank you in advance.

Jeff

I was using the JSON Linter here > https://jsonlint.com/ and it appeared there was something the matter with the &quote;

Here is what I came up with.

[
		{
			"firstName": "John",
			"lastName": "Doe",
			"birthDate": "1900-01-01",
			"city": "Somewhere",
			"stateCode": "CA",
			"zipCode": "xxxxx",
			"countryCode": "US",
			"emailMarketingStatus": "Subscribed",
			"phones": [{
				"phone": "+1xxxxxxxxxx"
			}],
			"emails": [{
				"email": "somebody@gmail.com"
			}]
		}, 
		{
			"firstName": "Jane",
			"lastName": "Doe",
			"birthDate": "1900-01-01",
			"city": "Somewhere",
			"stateCode": "CA",
			"zipCode": "xxxxx",
			"countryCode": "US",
			"emailMarketingStatus": "Unsubscribed",
			"phones": [{
				"phone": "+1xxxxxxxxxx"
			}],
			"emails": [{
				"email": "xxxxxx@yahoo.com"
			}]
		}
]

Hey thank you for taking the time to look into this. I used the data you pasted and exact same issue. I ran the code in another JSON analyzer and got “valid”, so I’m going to have to contact the vendor I suppose. Thank you again!

@jsmcdon1 How are you sending this data to the back-end?
Is the body set to Raw with type as JSON?
Refer the screenshot:

Hi. Yes that’s how I’m sending I just got confirmation from the vendor that they can only receive one record at a time. So I need to figure out how to build a loop in postman.

Thanks for your help looking into this for me

@jsmcdon1 Got it. I suggest you read through this: Building workflows in Postman using Collection Runner and this should solve your problem.

Along with that, you might need to work with a data file to send in your JSON request body for every iteration.

Great. Thank you so much.