
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2020 06:05 AM
Hi everyone,
I’ve been trying to find a function that would allow a “Value to field” mapping such as this:
As depicted, i would like to use Values as Keys in order to use them in expression libraries for value mapping tables.
I’ve been trying several functions, but my knowledge of Json & Javascript is rather limited, just starting out with Snaplogic and haven’t had any trainings either i’m afraid.
I’d appreciate any help!
Thanks and best regards
Thomas
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2020 09:05 AM
Hi @Henchway,
In this post, I have attached a pipeline that can demonstrate my solution to your question.
In the first JSON Generator Snap I generate the test data according to your problem statement.
Then I use a Group By N Snap to generate input for the final snap in a usable format.
Lastly, in the final snap, a JSON Generator, I use Apache Velocity to output the data in the desired format.
Please have a look at the pipeline, and I’ll be happy to answer any further questions you may have.
BR,
Dimitri
ValueToFieldMapping_2020_03_23.slp (4.5 KB)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2020 09:05 AM
Hi @Henchway,
In this post, I have attached a pipeline that can demonstrate my solution to your question.
In the first JSON Generator Snap I generate the test data according to your problem statement.
Then I use a Group By N Snap to generate input for the final snap in a usable format.
Lastly, in the final snap, a JSON Generator, I use Apache Velocity to output the data in the desired format.
Please have a look at the pipeline, and I’ll be happy to answer any further questions you may have.
BR,
Dimitri
ValueToFieldMapping_2020_03_23.slp (4.5 KB)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2020 04:42 AM
Thank you very much! This is exactly what I’ve been looking for.
Best regards
Thomas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2021 04:34 AM
Perfect! I like your solution.
