I want to iterate a block array from Slack, create different variables and then update one single database in Notion with both variables.
What is the problem & what have you tried?
I created two different variables (I will have to create more but for now just testing), and now I am not able to aggregate them again to obtain a clear structure of elements that can be used for my Notion scenario. Can’t introduce an array aggregator and can’t connect both variable set scenarios to Notion.
Error messages or input/output bundles
No errors, just got stuck understanding if the previous steps are wrong for what I want to achieve.
If I don’t set the variable, I am unable to retrieve values from the Iterator. And I am not able to set multiple variables because I need to indicate the exact element of the array I want to extract.
So with the first variable I am extracting the first element I need from the initial array, and with the second variable I am extracting the second element.
I am unsure if this is a wider ride than expected, but I made several attempts with iterator only and never worked. Output is always empty, and get map functions do not help me because the initial array has multiple collections.
how the macro collection is unpacked in 16 different bundles.
if I don’t set variables, I have no way to map notion dimensions with the bundles I have just extracted (only the last bundle is visible from the Iterator module).
The final goal is feeding a data source in Notion. So a Notion page is composed of several properties: I need to map three of my output bundles to specific Notion dimensions.
This is the starting input:
Text
New Feature Request request from <@U024ZAPBVB4> for the RevOps Team
*Feature description*
Club X wants to integrate the accounting solution with Playtomic data
*Feature Title*
Request to include an API for Payments
*Product Triage*
Chains
This input [block] is considered by Slack as an Array whose type is rich_text_section and is composed of 16 collections.
{“type”:“rich_text_section”,“elements”:[{“type”:“text”,“text”:“New “},{“type”:“text”,“text”:“Feature Request”},{“type”:“text”,“text”:” request from “},{“type”:“user”,“user_id”:“U024ZAPBVB4”},{“type”:“text”,“text”:” for the RevOps Team\n\n”},{“type”:“text”,“text”:“Feature description”,“style”:{“bold”:true}},{“type”:“text”,“text”:“\n”},{“type”:“text”,“text”:“Club X wants to integrate the accounting solution with Playtomic data”},{“type”:“text”,“text”:“\n”},{“type”:“text”,“text”:“Feature Title”,“style”:{“bold”:true}},{“type”:“text”,“text”:“\n”},{“type”:“text”,“text”:“Request to include an API for Payments”},{“type”:“text”,“text”:“\n”},{“type”:“text”,“text”:“Product Triage”,“style”:{“bold”:true}},{“type”:“text”,“text”:“\n”},{“type”:“text”,“text”:“Chains”}]}
And do you need the entire text block together or split it in separate parts? Also is this standardized text? Will all bundles follow the same logic or will there be differences?
You can use an iterator followed by a text aggregator to rebuild the text back in a single string and then follow it with a match pattern module to extract different elements. This will work regardless of the length and exact structure of the incoming text block, as long as the overall structure is the same.
Many thanks, text aggregator + match pattern works. I was not so far away from the solution. I have more logics so it should be readapted a little bit, but I think I can manage it on my own. Thanks again