Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Split complex string into multiple columns

EJenkins
5 - Atom

I get a data dump that has a column called Metatdata with the following values

 

[{"templateId":"InternalMetadata","fields":{"Operator":"JSmith","Group ID":"8","Document Num":"3452","Doc Edit Date":"1/1/2023 12:18:36 PM","Description":"SecondAmendment_of_the_Agreement","SubType":"na","Keywords":"ACQ FIN","Doc Create Date":"1/1/2022 2:00:00 PM","individual ID":"43","Department":"ACQ","Author":"JSmith","Final":"True","DocType":"FIN"}}]

 

and a second row

 

[{"templateId":"InternalMetadata","fields":{"Operator":"AJackson","Group ID":"7","Document Num":"2345","Doc Edit Date":"5/1/2023 12:18:36 PM","Description":"Proof_of_Concept_New_Model","SubType":"na","Keywords":"Analytics Excel","Doc Create Date":"4/1/2023 12:00:00 PM","individual ID":"78","Department":"BI","Author":"AJackson","Final":"True","DocType":"Excel"}}]

 

What I'm trying to do is split this data into columns as follows

 

TemplateIDFieldsOperatorGroup IDDocument NumDoc Edit DateDescriptionSubTypeKey WordsDoc Create Date
InternalMetadata{JSmith834521/1/2023SecondAm...naACQ FIN1/1/2022
InternalMetadata{AJackson723455/1/2023Proof_Of_C...naAnalytics Excel4/1/2023

 

Essentially I need to find "*": and make the * into column headers, Then find :"*" and make the * the value for those columns. I looked at some similar examples where regex was used but my knowledge of Perl is zero and I wasn't able to figure out the necessary regular expressions. The Fields description doesn't follow this pattern but the values always start with the same expression [{"templateId":"InternalMetadata","fields":{ and I'd be fine if that was just gone. I would like all columns from operator to doc type. 

 

 

2 REPLIES 2
geraldo
13 - Pulsar

@EJenkins 

 

Json Parse Tool

an workflow example

 

geraldo_0-1683928475256.png

 

 

binuacs
21 - Polaris

@EJenkins similar approach to @geraldo , added a few tools to keep the order of the columns as it is 

 

binuacs_0-1683993199237.png

 

Labels