This topic was automatically generated from Slack. You can find the original thread here.
Hey guys, I’m new to Pipedream and trying to determine the best/proper way to do something here.
I’m trying to create a bi-directional integration from Slack to WhatsApp using ultramsg. It uses webhook for receiving WA messages and the ultramsg integration for sending WA messages. I have it working for one group/channel but am having trouble determining the proper way to integrate multiple groups. ultramsg forwards all incoming messages to a single webhook which fires a single trigger; how can I incorporate an if-then structure (or filter, custom code, etc.) in the action step so that I can send the message to different Slack channels depending on the webhook data body (i.e. who the message is from)?
I see filter but it looks like only continue or end execution. I want to have basically a switch-case for webhook from data to decide which slack channel to send to. Do I have to write custom code or can this be achieved with filter and send_message_private_channel?
If it makes anything easier, you could also do the filtering / switch-case logic in a code step, then kick off a separate workflow to handle separate logic, if that’s necesssary
That’s a solid idea if needed but sounds like bloat to maintain each slack channel in its own workflow. I think best solution (if possible) is to have a code step that looks up the appropriate Slack channel based on the incoming webhook and then dynamically populate send_message_private_channel.Channel
Yep totally. Will the Slack channel name/ID be returned directly in the webhook response? Or will you have to look that up elsewhere, based on some identified coming from the webhook?
This is great, thanks! Looking into using data stores now but I would want to associate one to one string-string records. Is data store only KV pairs and if I wanted to look up a key from a query with a value then I’d have to loop?
I don’t totally follow — can you elaborate on your question? You can store any JSON-serializable data as a value for a Data Store record, so a single record could be an array of KVs if you want, or you can structure it as many records with a single KV pair each record.