Skip to main content
Nintex Community Menu Bar

Get usable JSON from NWC Task form / Repeater

  • September 24, 2021
  • 5 replies
  • 211 views

Forum|alt.badge.img+3

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

19824iB8F86169E6BF6711.png

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

19825i19FA15B7E8CAEE83.png

 

Thanks in advance.

5 replies

Forum|alt.badge.img+11
  • Contributor
  • September 27, 2021

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. 


butlerj
Nintex Employee
Forum|alt.badge.img+20
  • Nintex Employee
  • September 29, 2021

@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-instance-start-data-naming.

 

Not sure that there is currently another way around this.


Forum|alt.badge.img+3
  • Author
  • Nintex Partner
  • September 29, 2021
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.

Forum|alt.badge.img+3
  • Author
  • Nintex Partner
  • September 29, 2021
@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.

Callan.Applebee
Forum|alt.badge.img+1

Is there a way to easily generate a JSON output from the form submitted? I am new in that specific space and would love an action or something that could easily summarise the form and captured information and generate a usable JSON. I need something that does that and appends the JSON file to something like an email action. I also want to try and avoid having to use SPO etc to store the file and then retrieve the file. SmartIQ and other such forms and workflow engines can do that natively, however Nintex does not appear to have something that I would consider a core easy win.

Thanks.