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

Parse JSON Custom Action

Jump to solution

Would it be possible to develop a custom Nintex workflow action to accept in a JSON string and output a collection?  I'm aware of all of the issues involved with parsing JSON and am cool with that but am more interested to know if/how possible to have a custom action set a collection variable.  I didn't see anything in the SDK about returning collection variables.

Thanks in advance,

Eric

0 Kudos
Reply
16 Replies
Highlighted
Nintex Employee
Nintex Employee

Re: Parse JSON Custom Action

Jump to solution

Hi Eric,

it's definitely do-able. You're output just needs to be a C# array that your action will have access to.

In your Execute function, just check the variable types, especially the ResultOutput or whatever you call it and you'll see that it contains an array.  You will then able to have your JSON parser code, update/add to the array.

cheers,

Vadim

View solution in original post

Reply
eric_halsey
Nintex Newbie

Re: Parse JSON Custom Action

Jump to solution

Hi Vadim,

Thanks for the response.  As a follow up, do you know if we can we return arrays of arrays?  We might need this if our JSON contains nested arrays.

Regards,

Eric

0 Kudos
Reply
Nintex Employee
Nintex Employee

Re: Parse JSON Custom Action

Jump to solution

Hi Eric,

not really.

You could return an array of semi-colon or comma delimited strings that would be an array of arrays.

cheers,

Vadim

0 Kudos
Reply
Not applicable

Re: Parse JSON Custom Action

Jump to solution

Hi,

I am new to nintex workflow trying it out to see if it fits our organisation. We have a few "external" REST services that we would want to call in SharePoint and they all return JSON data. May I ask about this: "I'm aware of all of the issues involved with parsing JSON" highlighted in the original post. Can i parse the JSON data returned from a "Web Request" action and how do I do that?

0 Kudos
Reply
Automation Master
Automation Master

Re: Parse JSON Custom Action

Jump to solution

Do you have SharePoint on premise or in O365 ?

0 Kudos
Reply
Not applicable

Re: Parse JSON Custom Action

Jump to solution

On premise

0 Kudos
Reply
Automation Master
Automation Master

Re: Parse JSON Custom Action

Jump to solution

Then I think that you could manage to get information from a text in JSON format with the "Regular Expression" action.

Hope this helps

0 Kudos
Reply
Not applicable

Re: Parse JSON Custom Action

Jump to solution

Thanks for these prompt responses. I am not quite sure if RegEx would be accurate to use on a non-regular language (JSON). Are these some of the issues that the original poster was talking about? Is RegEx the ONLY way at the moment?

0 Kudos
Reply
Automation Master
Automation Master

Re: Parse JSON Custom Action

Jump to solution

Yes I think it's the only way. Maybe you can use string functions (Substring, Replace, Remove...) but I think it's less easy and practical to use than the regular expression to manipulate JSON format.

Reply