Ask Your Question

How can I convert an existing record's root field to MAP?

asked 2018-02-13 15:48:31 -0600

jeff gravatar image

I have a record whose root field is of some scalar type (say, for example STRING or BYTE_ARRAY). How can I convert the root type to a MAP so that subfields can be added, while preserving the previous root field value (ex: as /original)?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-02-14 08:09:12 -0600

tmcgrath gravatar image

I'm curious about this too. How about trying an Expression Evaluator with the emptyMap function to the / output field as shown in this screenshot?

image description


${record:value('/')} for / Output Field

edit flag offensive delete link more


Thanks, your suggestion of setting output field of / with ${emptyMap()} was exactly what I needed. The key in my case was to also capture the original root in an attribute so that I can then restore it afterward (after the root is set to map). That was done in another expression processor before.

jeff gravatar imagejeff ( 2018-02-14 22:05:09 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-02-13 15:48:31 -0600

Seen: 23 times

Last updated: Feb 14