I want to perform a simple transformation of this so I get an array of objects like so:
leadSources: [
{"name": "One"},
{"name": "Two"}
]
How might I go about doing this?
For further context:
The Data is coming from a form submission, from a Select element with 2 Options selected.
I am trying to update a Notion page property with the type of “multi-select”. I believe it takes in an array of objects with a key-value pair where “name” key has to be specified.
This is just a case where I’m not familiar enough with make and what it can and can’t do, any help is appreciated!
Please let me know if my question is not specific enough.
Hi @Rafal,
The only way I can figure to do this is by using Iterator (on the leadSources array) → Array Aggregator (aggregate just the Value) → Create JSON (custom data structure)
Here is what Iterator (#11) looks like:
Followed by an Aggregator (#12) and we aggregate just Value:
This is a custom Data Structure where Lead Sources is an array of Collections where each collection contains just a name property of type text. We map the array from aggregator into the Lead Sources field. When you create your Data Structure, use the Generate option and supply this JSON: { "leadSources": [ {"name": "One"}, {"name": "Two"} ] }
Beauty. Thank you for teaching me @Donald_Mitchell , I really appreciate it. I had no idea the iterator and aggragator exist. I’ll spend a bit more time on learning their capabilities
I’ve only ever used JS for this sort of stuff and I was completely stuck trying to recreate that through the logic/tools I was familiar with…