Thanks so much! That is very helpful. Using your example, I was able to output the proper string with total quantities for each.
However, in the original example I used, I was sort of summarizing the use case in an attempt to simplify it a bit. I’m wondering if you can help with the exact use case, as I’m hoping to display this on the layout side with actual attributes, instead of just as a text. Here’s an exact example of my use case…
After using your version of “JSON Final” in the POs table, I have a compiled JSON column that looks like this:
"paperStocks": [
{
"paperStockName": "Colorplan Rust 130# - 17.5 pt",
"paperSwatchColor": "https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/15ddj7K6XZ6W5o75fhxq/pub/Pbr9ZoZFIlkdKC66PFen.jpg",
"sheetsNeeded": 34
},
{
"paperStockName": "Colorplan Emerald 130# - 17.5 pt",
"paperSwatchColor": "https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/15ddj7K6XZ6W5o75fhxq/pub/RaHqVSTLTpzKs5trZRde.jpg",
"sheetsNeeded": 34
},
{
"paperStockName": "Colorplan Stone 130# - 17.5 pt",
"paperSwatchColor": "https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/15ddj7K6XZ6W5o75fhxq/pub/DStY9ubPnuNYI7LCqCjQ.jpg",
"sheetsNeeded": 50
},
{
"paperStockName": "Colorplan Real Grey 130# - 17.5 pt",
"paperSwatchColor": "https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/15ddj7K6XZ6W5o75fhxq/pub/josQfHiNtexMP15Tp6cT.jpg",
"sheetsNeeded": 50
},
{
"paperStockName": "Colorplan Rust 130# - 17.5 pt",
"paperSwatchColor": "https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/15ddj7K6XZ6W5o75fhxq/pub/Pbr9ZoZFIlkdKC66PFen.jpg",
"sheetsNeeded": 7
},
{
"paperStockName": "Colorplan Emerald 130# - 17.5 pt",
"paperSwatchColor": "https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/15ddj7K6XZ6W5o75fhxq/pub/RaHqVSTLTpzKs5trZRde.jpg",
"sheetsNeeded": 19
},
{
"paperStockName": "Colorplan Stone 130# - 17.5 pt",
"paperSwatchColor": "https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/15ddj7K6XZ6W5o75fhxq/pub/DStY9ubPnuNYI7LCqCjQ.jpg",
"sheetsNeeded": 7
},
{
"paperStockName": "Colorplan Real Grey 130# - 17.5 pt",
"paperSwatchColor": "https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/15ddj7K6XZ6W5o75fhxq/pub/josQfHiNtexMP15Tp6cT.jpg",
"sheetsNeeded": 13
},
{
"paperStockName": "Colorplan Rust 130# - 17.5 pt",
"paperSwatchColor": "https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/15ddj7K6XZ6W5o75fhxq/pub/Pbr9ZoZFIlkdKC66PFen.jpg",
"sheetsNeeded": 25
},
{
"paperStockName": "Colorplan Stone 130# - 17.5 pt",
"paperSwatchColor": "https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/15ddj7K6XZ6W5o75fhxq/pub/DStY9ubPnuNYI7LCqCjQ.jpg",
"sheetsNeeded": 25
},
{
"paperStockName": "Colorplan Real Grey 130# - 17.5 pt",
"paperSwatchColor": "https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/15ddj7K6XZ6W5o75fhxq/pub/josQfHiNtexMP15Tp6cT.jpg",
"sheetsNeeded": 25
},
{
"paperStockName": "Colorplan Rust 130# - 17.5 pt",
"paperSwatchColor": "https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/15ddj7K6XZ6W5o75fhxq/pub/Pbr9ZoZFIlkdKC66PFen.jpg",
"sheetsNeeded": 9
},
{
"paperStockName": "Colorplan Emerald 130# - 17.5 pt",
"paperSwatchColor": "https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/15ddj7K6XZ6W5o75fhxq/pub/RaHqVSTLTpzKs5trZRde.jpg",
"sheetsNeeded": 9
},
{
"paperStockName": "Colorplan Stone 130# - 17.5 pt",
"paperSwatchColor": "https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/15ddj7K6XZ6W5o75fhxq/pub/DStY9ubPnuNYI7LCqCjQ.jpg",
"sheetsNeeded": 9
}
]
}
Using your javascript - slightly modifying it - I’m able to have that output as a string, where it correctly combines all of the likeminded “colors” (by paperStockName in my case). However, instead, I modified the code to output as JSON, with the result being:
{
"paperStocks": [
{
"paperStockName": "Colorplan Rust 130# - 17.5 pt",
"paperSwatchColor": "https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/15ddj7K6XZ6W5o75fhxq/pub/Pbr9ZoZFIlkdKC66PFen.jpg",
"sheetsNeeded": 75
},
{
"paperStockName": "Colorplan Emerald 130# - 17.5 pt",
"paperSwatchColor": "https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/15ddj7K6XZ6W5o75fhxq/pub/RaHqVSTLTpzKs5trZRde.jpg",
"sheetsNeeded": 62
},
{
"paperStockName": "Colorplan Stone 130# - 17.5 pt",
"paperSwatchColor": "https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/15ddj7K6XZ6W5o75fhxq/pub/DStY9ubPnuNYI7LCqCjQ.jpg",
"sheetsNeeded": 91
},
{
"paperStockName": "Colorplan Real Grey 130# - 17.5 pt",
"paperSwatchColor": "https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/15ddj7K6XZ6W5o75fhxq/pub/josQfHiNtexMP15Tp6cT.jpg",
"sheetsNeeded": 88
}
]
}
Now that I have that compiled final JSON column for each PO, do you know of a way to display this as a list collection (or some other way) on the layout side of the PO screen?
Found this thread but couldn’t quite figure out how to make it work.