SanthoshKumar-R
Scholar

Get usable JSON from NWC Task form / Repeater

Hello,

 

I need to obtain all the field values from a task form and send it to an API.. Few times in the workflow.

I was wondering if I could get an usable JSON form of the Task form?

At least if I could move all of the controls inside a Repeater, will I be able to get useful JSON - the same way we used to get XML when using "Nintex for SharePoint" repeaters?

 

Sample form

SanthoshKumarR_0-1632495279224.png

and the cryptic output I get. The JSON variables have some random text appended.

SanthoshKumarR_1-1632495371461.png

 

Thanks in advance.

Labels: (2)
0 Kudos
Reply
4 Replies
bsikes
Apprentice

Re: Get usable JSON from NWC Task form / Repeater

Not sure if this is helpful or relevant to what you're trying to do, but I seem to be having luck getting collections into a JSON format with the following 4 actions:

  1. Create Text String 
    1. Input: Collection Variable Output: Text Variable
  2. Modify String
    1. Input: Text Variable Replace Substring: \" With string: " Output: Text Variable
  3. Modify String
    1. Input: Text Variable Replace Substring: "{ With string: { Output: Text Variable
  4. Modify String
    1. Input: Text Variable Replace Substring: }" With string: } Output: Text Variable

Once I run those 4 actions against my collection (Which I expect to be JSON already), it is a valid JSON string. 

 

Disclaimer: My collections are coming from built in actions and Xtension actions, not repeatable form sections. However, the formatting of the string in your screenshot is the same what I'm getting, so maybe it would work for you as well. 

0 Kudos
Reply
butlerj
Community Manager
Community Manager

Re: Get usable JSON from NWC Task form / Repeater

@SanthoshKumar-R I believe that this is related to how form variables as passed to the workflow engine for interpretation. We have a similar feature request open to better handle Start Variables (form variables included), which should also fix this problem if you'd like to add your vote to it: https://nintex.uservoice.com/forums/430063-5-nintex-workflow-cloud/suggestions/39801832-improved-ins....

 

Not sure that there is currently another way around this.

0 Kudos
Reply
SanthoshKumar-R
Scholar

Re: Get usable JSON from NWC Task form / Repeater

Thanks @bsikes. Thats good idea to make the JSON proper. But the data inside the JSON is cryptic. It doesn't allow to deserialise at the other end of the API.
0 Kudos
Reply
SanthoshKumar-R
Scholar

Re: Get usable JSON from NWC Task form / Repeater

@butlerj thanks for the response. Its related to Task forms. But yeah, conceptually I would like to get a JSON object for the whole form which shows meaningful names for columns rather than cryptic text. Looks like there is no option at the moment.
0 Kudos
Reply