Forum Discussion
Hi @Tanmay_Sarkar - this is a complex requirement. There are ways to have SnapLogic create multiple documents from a single document, but here you have multiple documents that need to first be analyzed and summarized to determine the total value, then split the “overflow” values into multiple documents. My recommendation is that you look into the Script snap and use the language of your choice (Javascript, Python, Ruby) to do this.
Thank you @koryknick
This makes sense. Depending on a script was definitely one of the options (and we managed to get this done with the help of a JavaScript).
Just thought to share this in the community and understand if there’s a way to get this done in SnapLogic directly.
Regards,
Tanmay
Can you provide a little more information? What does your schema look like and what do you want the output to look like?
- peter_ladis8 years agoNew Contributor
Here is my input side in the MAPPER
$field002
the target is this
$distributors
However when it goes into my mongo tables i need the distributor structure like this where values pop onto the array
var sample = {
proprty1:””
distributors:[“1”,”2”,”3"]
}
Thanks,Peter Ladis
LilyPad
Co-Founder
813-785-6241
peter@lilypad.co