JSON tool object name for unnamed object array

Confluence User - 13 Apr, 2020

The response payload looks something like this:

"data" : [ [ "row-eqdw_jd6f~f8xp", "00000000-0000-0000-818E-8F29C533B84C", 0, 1578331654, null, 1578331659, null, "{ }", "2004019019", "2019-10-28T00:00:00", "Single Family", "scrubbed address", "LOS ANGELES", "CA", "93063", "12", "scrubbed name", "scrubbed name", "scrubbed phone", "scrubbed name", "scrubbed name", "scrubed address", "scrubbed phone", "-118.61291", "34.22684", "scrubbed location", "4279", "92", "1423", null, "2", "44" ]
,[ "row-eqdw_jd6f~f8xp", "00000000-0000-0000-818E-8F29C533B84C", 0, 1578331654, null, 1578331659, null, "{ }", "2004019019", "2019-10-28T00:00:00", "Single Family", "scrubbed address", "LOS ANGELES", "CA", "93063", "12", "scrubbed name", "scrubbed name", "scrubbed phone", "scrubbed name", "scrubbed name", "scrubed address", "scrubbed phone", "-118.61291", "34.22684", "scrubbed location", "4279", "92", "1423", null, "2", "44" ] ]


How can I reference fields positionally in the JSON tool plugin configuration?

plugins;json

4


13 Apr, 2020
confluenceUser
confluenceUser

The second level should be an object. And the object should have an attribute name followed by the value. The JSON Tool requires named attributes so that it knows which is which field's value. I afraid your JSON data is not suitable to be used here. Can you ask your provider to change the return data?

13 Apr, 2020
confluenceUser
confluenceUser

This is an institutional data feed.  Requesting the change is impractical since making the change would be impossible.  Are there tools that can be used in a workflow to restructure or decode the data?

15 Apr, 2020
confluenceUser
confluenceUser

Hi Brian - you can use Json to import the data: arrays into a temp sql form.  then you can run some jdbc sql manipulation to extract values based on position.... 

07 May, 2020
confluenceUser
confluenceUser

In the JSON Tool, https://github.com/jogetworkflow/jw-community/blob/7.0-SNAPSHOT/wflow-core/src/main/java/org/joget/apps/app/lib/JsonTool.java#L201 you will need to perform the field mapping. The data that you have is...

"data": [
  ["row-eqdw_jd6f~f8xp", "00000000-0000-0000-818E-8F29C533B84C", 0, 1578331654, null, 1578331659, null, "{ }", "2004019019", "2019-10-28T00:00:00", "Single Family", "scrubbed address", "LOS ANGELES", "CA", "93063", "12", "scrubbed name", "scrubbed name", "scrubbed phone", "scrubbed name", "scrubbed name", "scrubed address", "scrubbed phone", "-118.61291", "34.22684", "scrubbed location", "4279", "92", "1423", null, "2", "44"],
  ["row-eqdw_jd6f~f8xp", "00000000-0000-0000-818E-8F29C533B84C", 0, 1578331654, null, 1578331659, null, "{ }", "2004019019", "2019-10-28T00:00:00", "Single Family", "scrubbed address", "LOS ANGELES", "CA", "93063", "12", "scrubbed name", "scrubbed name", "scrubbed phone", "scrubbed name", "scrubbed name", "scrubed address", "scrubbed phone", "-118.61291", "34.22684", "scrubbed location", "4279", "92", "1423", null, "2", "44"]
]

There's no attribute to tell the values though. The JSON Tool expects data to be returned this way so that it will know which is city, which is state for example.

{ "data" : [
	{ "city" : "LOS ANGELES",
	  "state" : "CA"}
]
}

I guess the best way forward is to fork this code since it is open source and develop a process tool plugin.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print