Ask Your Question
0

handle the list_map in nested json.

asked 2020-05-27 04:17:39 -0500

anonymous user

Anonymous

Hi ,

I have a nested json as below.

{ "grandfather":[ { "father":{"source": "hshhshh", "value": "12345"} , "mother":{"source": "hshhshh", "value": "12345"}, "daughter":{"source": "hshhshh", "value": "12345"} } { "father1":{"source": "hshhshh", "value": "12345"} , "mother1":{"source": "hshhshh", "value": "12345"}, "daughter1":{"source": "hshhshh", "value": "12345"} } ] }

and i want to convert it into below. { "grandfather":[ { "father":{"source": "hshhshh", "value": "12345"} , "north_mother":{"source": "hshhshh", "value": "12345"}, "north_daughter":{"source_place": "hshhshh", "value": "12345"} } { "father1":{"source": "hshhshh", "value": "12345"} , "north_mother1":{"source": "hshhshh", "value": "12345"}, "north_daughter1":{"source_place": "hshhshh", "value": "12345"} } ] }

remarks: grandfather = List[1,2] father, mother, daughter = map{} rest is fields

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-05-30 19:36:07 -0500

iamontheinet gravatar image

updated 2020-05-30 20:24:45 -0500

Hi!

You can use Field Mapper to alter a set of field paths, field names, or field values using expressions. For example, I used the following conditional and mapping expressions to prefix "mother" and "daughter" field names with "north_".

image description


image description


Note that you will need to play around with the expressions to get your desired output, but hopefully this gives you some ideas and/or a head start.

Cheers, Dash

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-05-27 04:17:39 -0500

Seen: 29 times

Last updated: May 30