marlon1337
Member
Hi guys,
I can't figure out how to transform a json with the selecttransform integration.
The template works at https://selecttransform.github.io/playground/ but when pasting it to Pabbly I get an error.
Here is what works on the selecttransform playground:
Here is the error in pabbly. I tried pasting it in many ways. with "" for every value, deleting breaks and spaces adding three {{{, with template= with var = template... etc. All possible combinations, nothing works.
In the end I need the transformed JSON to be the raw data in a custom API POST. The transformed JSON for the JSON above will look like this:
Inserted here:
I appreciate any help. Thank you!
I can't figure out how to transform a json with the selecttransform integration.
The template works at https://selecttransform.github.io/playground/ but when pasting it to Pabbly I get an error.
Here is what works on the selecttransform playground:
JSON:
var data =
[{"id":1000470,"name":"Rainglide One 70cm","product_id":230412,"variation_id":0,"quantity":2,"tax_class":"","subtotal":"42.61","subtotal_tax":"9.37","total":"42.61","total_tax":"9.37","taxes":[{"id":63,"total":"9.373443","subtotal":"9.373443"}],"meta_data":[{"id":1004807,"key":"_unit","value":"","display_key":"_unit","display_value":""},{"id":1004808,"key":"_unit_base","value":"","display_key":"_unit_base","display_value":""},{"id":1004809,"key":"_unit_product","value":"","display_key":"_unit_product","display_value":""},{"id":1004810,"key":"_item_desc","value":"","display_key":"_item_desc","display_value":""},{"id":1004811,"key":"_defect_description","value":"","display_key":"_defect_description","display_value":""},{"id":1004812,"key":"_delivery_time","value":"","display_key":"_delivery_time","display_value":""},{"id":1004813,"key":"_min_age","value":"","display_key":"_min_age","display_value":""}],"sku":"RO70","price":21.3032785,"image":{"id":"230396","src":"https:\/\/rainglide.com\/wp-content\/uploads\/2025\/01\/Rainglie-One-Shop-Picture.jpg"},"parent_name":null},{"id":1000471,"name":"Rainglide One 65cm","product_id":230411,"variation_id":0,"quantity":3,"tax_class":"","subtotal":"63.91","subtotal_tax":"14.06","total":"63.91","total_tax":"14.06","taxes":[{"id":63,"total":"14.060164","subtotal":"14.060164"}],"meta_data":[{"id":1004823,"key":"_unit","value":"","display_key":"_unit","display_value":""},{"id":1004824,"key":"_unit_base","value":"","display_key":"_unit_base","display_value":""},{"id":1004825,"key":"_unit_product","value":"","display_key":"_unit_product","display_value":""},{"id":1004826,"key":"_item_desc","value":"","display_key":"_item_desc","display_value":""},{"id":1004827,"key":"_defect_description","value":"","display_key":"_defect_description","display_value":""},{"id":1004828,"key":"_delivery_time","value":"","display_key":"_delivery_time","display_value":""},{"id":1004829,"key":"_min_age","value":"","display_key":"_min_age","display_value":""}],"sku":"RO65","price":21.303278666666667,"image":{"id":"230396","src":"https:\/\/rainglide.com\/wp-content\/uploads\/2025\/01\/Rainglie-One-Shop-Picture.jpg"},"parent_name":null},{"id":1000472,"name":"Rainglide One 60cm","product_id":230410,"variation_id":0,"quantity":1,"tax_class":"","subtotal":"20.48","subtotal_tax":"4.51","total":"20.48","total_tax":"4.51","taxes":[{"id":63,"total":"4.506394","subtotal":"4.506394"}],"meta_data":[{"id":1004839,"key":"_unit","value":"","display_key":"_unit","display_value":""},{"id":1004840,"key":"_unit_base","value":"","display_key":"_unit_base","display_value":""},{"id":1004841,"key":"_unit_product","value":"","display_key":"_unit_product","display_value":""},{"id":1004842,"key":"_item_desc","value":"","display_key":"_item_desc","display_value":""},{"id":1004843,"key":"_defect_description","value":"","display_key":"_defect_description","display_value":""},{"id":1004844,"key":"_delivery_time","value":"","display_key":"_delivery_time","display_value":""},{"id":1004845,"key":"_min_age","value":"","display_key":"_min_age","display_value":""}],"sku":"RO60","price":20.483607,"image":{"id":"230396","src":"https:\/\/rainglide.com\/wp-content\/uploads\/2025\/01\/Rainglie-One-Shop-Picture.jpg"},"parent_name":null}]
;
var template = {
billable:{
products: {
"{{#each this}}": {
name: "{{this.name}}",
qty: "{{this.quantity}}",
unit_price: "{{this.price}}"
}}
}
}
Here is the error in pabbly. I tried pasting it in many ways. with "" for every value, deleting breaks and spaces adding three {{{, with template= with var = template... etc. All possible combinations, nothing works.
In the end I need the transformed JSON to be the raw data in a custom API POST. The transformed JSON for the JSON above will look like this:
Code:
{
"billable": {
"products": [
{
"name": "Rainglide One 70cm",
"qty": 2,
"unit_price": 21.3032785
},
{
"name": "Rainglide One 65cm",
"qty": 3,
"unit_price": 21.303278666666667
},
{
"name": "Rainglide One 60cm",
"qty": 1,
"unit_price": 20.483607
}
]
}
}
Inserted here:
I appreciate any help. Thank you!