I am attempting to duplicate Slack messages, including their blocks, from one channel to another. Unfortunately, I am encountering an error with the message
Function 'getBlocksData' finished with error! JSON for blocks is invalid. I am currently investigating the cause of this issue.
Our organization has established a Slack channel for the centralization of monitoring messages from various sources, including NodeJS and Python backend applications, SaaS monitoring tools, and automation tools. The messages are reviewed and analyzed by designated human observers.
In order to enhance client focus, we aim to duplicate relevant messages into individual client-specific channels. This will enable our Account Managers to effectively track and follow up on client-related issues on a per-client basis. Despite recognizing the limitations of Slack for this purpose, I have been assigned to implement this solution after considering and evaluating alternative tools such as DataDog and Kibana.
** Steps taken***
I have established a scenario that includes a Slack Public Channel Watcher and a Router, followed by a Slack Create Message action that only processes filtered input. This setup is functioning as intended.
However, the Slack messages consist of Slack Blocks, and I am encountering difficulties in duplicating these blocks, with the said error message. I have conducted research to locate a function similar to
JSON.Stringify() to resolve this issue, but have been unsuccessful thus far.
Could someone assist me in resolving this issue?
This error occurred because empty data was being sent via the Slack “Create a message” module.
Please make sure that the mapped variables in the text field contain data.
Or there can be some rogue invisible character, causing the error.
I would recommend running our DEV tool right after the error run and see if you can spot something off in the code.
(unfortunately, this can be done only during the live run
Here is a link to the dev tool (F12 to press after the run)
I would suggest using the slack make api call option.
It should pull all the nested collections, and you could use the map function combined with string functions. Then use the make API call to send to another channel.
Thank you so much for taking the time to provide an answer to my previous question. I really appreciate it.
Regarding your suggestion of using the Slack Make API Call option, could you please provide me with more details on how this solution works and how it can be used to pull all the nested collections? Specifically, could you explain to me how the map function combined with string functions can be used in this context?
This is what I have now. Error message is different, but the output seem to be the same.
Thank you for your time and assistance.
I wanted to let you know that I created a new thread in the forum asking for an issue ticket to be opened to investigate this issue (link).
While I was able to work around the problem by using the format defined in the Slack API Call module, this solution is far from ideal. I would prefer a generic solution that would accept any type of Blocks formatted message.
Unfortunately, I am still struggling to understand how to use the map and string functions properly. If anyone has any guidance or resources they could share with me, it would be greatly appreciated.
Thank you for your time and attention to this matter. I look forward to hearing any updates or solutions.