cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

JSON value split by comma

philliperamos
Contributor

Hi, Iโ€™m trying to split the value โ€œConfigValueโ€ string in the following JSON :

[
{
PipelineID: 25
PipelineName: โ€œCashValue_Mainโ€
ConfigName:โ€œCashValueDatesโ€
ConfigValue:โ€œ1218, 1217โ€
}
]

Into a JSON document like this:
{
โ€œYearEndโ€: 1218
}
{
โ€œYearEndโ€: 1217*
}

Whatโ€™s the best process that I can use to do this? JSON Splitter or Mapper, or a combination of both?

Any assistance would be greatly appreciated.
Thanks!

1 ACCEPTED SOLUTION

cstewart
Former Employee

This is fairly easy, first use a mapper to split your ConfigValue field: $ConfigValue.split(โ€œ,โ€), and then use the JSONSplitter to split out into multiple documents:
50

I attach an export of the pipeline.
SplitField_2019_09_03.slp (8.1 KB)

View solution in original post

2 REPLIES 2

cstewart
Former Employee

This is fairly easy, first use a mapper to split your ConfigValue field: $ConfigValue.split(โ€œ,โ€), and then use the JSONSplitter to split out into multiple documents:
50

I attach an export of the pipeline.
SplitField_2019_09_03.slp (8.1 KB)

Thanks alot @cstewart ! It works as I needed!