Question

Stuck in a Loop: Forwarding Image (File) from Slack Channel A to B to A to B to A...

  • 15 December 2023
  • 3 replies
  • 31 views

I’ve reviewed this thread and tried the proposed solution: 

 

I’m trying to take an image/screenshot posted on Channel A and automatically post it in Channel B. The problem is that when the image is posted as a New File on Channel B, it triggers the same Zap and forwards the image back to Channel A, which then triggers the Zap and forwards the “new” image to Channel B, and so on and so forth.

 

Here’s my setup:

 

Zap Setup: Forward Images from Channel A to Channel B
Step 1: New File (the image) in Slack
Step 2: Determine Channel A Name from Channel B ID
​​​
Step 3: Determine Channel B ID from Channel A Name
Step 4: Send Channel Message in Slack
 
Send Channel Message in Slack

 

And here’s the table I see to create the relationship between Channels A and B:

 


3 replies

Userlevel 7
Badge +11

Hello there @hummus, welcome to the Community!

Am I correct in thinking that you only want the Zap to trigger for files added into Channel A, so that these can then be sent to Channel B? 

If so, in the New File trigger you’ll want to select Channel A. This will ensure that the Zap will only be checking that specific channel for new files:
cc6497a0d6ad4cef30490d9164d4f712.png
At present with no channel selected it will be looking for new files in all channels, including Channel B - which is what is causing the Zap to get stuck in a loop. 

That said, if the Zap needs to trigger for multiple different channels but not all of them, then you may need to add a filter to the Zap to prevent the Zap from triggering for every single Channel - just certain ones. See our Add conditions to Zaps with filters guide for details on how to work with filters.

Can you give that a try and let us know if that fixes it?

Hi @SamB, thanks for the reply!

I’d like the Zap to trigger for all channels. I’ve set up Slack so that there are English channels (with a en- suffix) and Russian channels (with a ru- suffix). I’d like any picture posted on a Russian channel to be automatically forwarded (as a file) to its English “sister channel”, and vice-versa. Would that be possible?

I’m thinking, perhaps there’s a way to mark a file as “already forwarded”, somehow; but I’m not sure how to retrieve that information once the file is shared (is it re-uploaded?) on a sister channel. 

Userlevel 7
Badge +14

Hi @hummus 

You will have to add data that a Filter as Step 2 can use to stop the infinite loop.

Reply