Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

dataProvider valid data format

Avatar

Level 3

I'm playing with data providers in target and face an issue when try to send array to target. I'm getting error“Invalid Json. Location: line - 1, column - 653.”

And it corresponds with array as value for property

this one is fine

"param1": "test", "param2": 123

but payload like this causing error 

"param1": "test", "param2": ["test", "test2"]

In documentation is says "params: A JSON object ... " and my payload is a valid json object

 

 

1 Reply

Avatar

Level 4
...
var data = {
  "param1": "test",
  "param2": 123
}

...

data = JSON.parse(data); // maybe this line helps
callback(error, data);

Maybe it is enough if you use JSON.parse.

 

best regards