This topic was automatically generated from Slack. You can find the original thread here.
Hello. I was hoping to find some help or examples for an action to send Notion Tags (Multi-select) values to Google Sheets.
Currently, I have to manually grab each value, ( I have 100+ tags) on a Notion database field. But when I enter them in manually to parse to Google Sheets, if the tag doesn’t exist, I get “undefined” populated into the Google Sheets cell.
You can store all of the available tags for a Notion database field into Data Store, then you can use the presence of tags in that action you shared to determine the “missing” value of the other tags.
{{steps.trigger.event.properties["Authorized People (new)"].multi_select[0].name}}, {{steps.trigger.event.properties["Authorized People (new)"].multi_select[1].name}}, {{steps.trigger.event.properties["Authorized People (new)"].multi_select[3].name}}, {{steps.trigger.event.properties["Authorized People (new)"].multi_select[4].name}}, {{steps.trigger.event.properties["Authorized People (new)"].multi_select[5].name}}
I couldn’t use an expression like:
{{steps.trigger.event.properties["Authorized People (new)"].multi_select[0-*].name}}
given there’s a step export steps.trigger.event.properties["Authorized People (new)"].multi_select that contains an array of objects, and each object has a name property, could you show me how to use a Node.js code step to extract all of the name properties into a single array of strings?
Certainly! You can use a Node.js code step with the map function to extract the name properties from the array of objects. Here’s an example: export default defineComponent({ async run({ steps }) { const multiSelect = steps.trigger.event.properties["Authorized People (new)"].multi_select; const names = multiSelect.map(item => item.name); return names; }, }); This code step takes the multi_select array from the steps.trigger.event.properties["Authorized People (new)"] and maps each object’s name property into a new array called names. The names array will contain all the name properties as strings.
Sure! You can use the filter function to remove null or undefined values from the names array. Here’s the updated code: export default defineComponent({ async run({ steps }) { const multiSelect = steps.trigger.event.properties["Authorized People (new)"].multi_select; const names = multiSelect.map(item => item.name).filter(name => name !== null && name !== undefined); return names; }, }); This code step filters out any null or undefined values from the names array, leaving only strings.
Well, I will go ahead and pay for Bardeen.ai, or Notion2sheets.
If Pipedream decides to add a support field for Notion Multiselect fields, it would be easier for non-coders to use, then I will try again, if that happens.