cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Parsing JSON returned from a REST service in Nintex workflow

Can anyone assist with parsing JSON in Nintex workflow. I have tried using RegEx after finding out that this is possibly the only way to parse JSON in Nintex workflow but cannot seem to get result as a collection. My example json data return is as follows:

{"employees":{"count":3,"data":[{"name":"peter","age":"31","department":"Sales"},{"name":"caroline","age":"22","department":"IT"},{"name":"emma","age":"26","department":"IT"}]}}

I would like to end up with a collection variable with the 3 employees' names in it. "peter,caroline,emma".

I have tried with a combination of these expressions:

({.*?})/gi        => to get {..} data items AND

"(name)":"((\\"|[^"])*)"/i      => to get an name element.

I simply can't get this to work using the Nintex Action - Regular expression. I am new to Nintex, evaluating it for possible use in our organisation, so I am not sure if this is the best way to access our "External" rest services that we need to utilize in SharePoint 2013. The summary of the test workflow I have is as below:

regex_problem.png

I don't have to user RegEx, I just need a solution that works to parse JSON data.

UPDATE:

I have since had some useful responses in this thread Re: Parse JSON Custom Action which helped me come to a conclusion.

Title was edited by: Jason Dembaremba

0 Kudos
Reply
1 Reply
bradleyl
Nintex Newbie

Re: Parsing JSON returned from a REST service in Nintex workflow

Just thought I'd add in here that Nintex regular expressions does support LookBehind and Lookahead expressions

So to simply extract the value for a given "name"

try 

(?<="name":")([^"]*)(?=")

should give you the value from a JSON string containing  "name":"value of name"  

It matches a string not containing the " character which comes after the string "name":" 

and is followed by the " character

Reply