cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Nintex Newbie

How to build a JSON

Jump to solution

Hi everyone,

 

I use nintex Xtension to interact with Google Sheet V4 API.

In the body request I need to send JSON structure, but I don't know how to Build a JSON.

The structure that I want to build is a json multi dimensional array, (an Array of Array).

For exemple : 

[["Val1.1","Val1.2],["Val2.1","Val2.2"]]

In the action "Add item to collection" we can't add collection, only text, int...

 

anyone knows how to achieve this ?

Labels: (1)
0 Kudos
Reply
5 Replies
Highlighted
Nintex Employee
Nintex Employee

Re: How to build a JSON

Jump to solution
Hi,
Could you use a combination of Build String actions and maybe regular expressions to create the string and just put it into a text variable?
0 Kudos
Reply
Highlighted
Nintex Newbie

Re: How to build a JSON

Jump to solution

Hi, No I can't, because if I store my JSON value in a string variable when the query is sent, the body value is transformed as a string and not array, and I get an error because I pass an array who contains string value and not an Array who contains Array Who contains string value.

 

For exemple, my array is called "values" and I put my JSON array as string in it, the query will be 

"body": {"values":["[\"test1\",\"test2\",\"test3\"]"]}

And not : 

"body": {"values":[[\"test1\",\"test2\",\"test3\"]]}
0 Kudos
Reply
Highlighted
Nintex Newbie

Re: How to build a JSON

Jump to solution

Pinging @sean_fiene on this to see if he has any thoughts about it.

Tags (2)
0 Kudos
Reply
Highlighted
Nintex Newbie

Re: How to build a JSON

Jump to solution

Was there any additional information to this @nico @eharris04 as I'm running into the same issue.

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: How to build a JSON

Jump to solution

for the moment no, there is no change, it is impossible to build complex objects with Xtension. But, normally, this is planned in a future version.

 

I success to make API calls with complex objects (for me it's the Google Sheet API) by simply using the "Call Web Service" action and set all the Header and body. (Make several calls to get the authentication token and then make the API calls)

View solution in original post

Reply