Background
If an Applet includes an image ingredient, it will use the image URL from that ingredient in the relevant action field. Sometimes, a URL might not be available in which IFTTT will default to a 'File not found' image.
An example this would be if your Applet is using the RSS Feed service's New Feed Item trigger paired with the Twitter service's Post a Tweet with Image action using the entryimageURL ingredient in the Image URL field:
If a new feed entry triggers the Applet but doesn’t include an image URL, a "File Not Found" image will be posted since there’s no image available for the EntryImageURL ingredient.
You can use filter code to skip posts without an image or follow the steps below to assign a default image instead of displaying the "File Not Found" image.
How to Assign a Fallback Image
Filter code can be used to set a default image if the image ingredient in your Applet doesn’t include one when the Applet runs.
This example demonstrates how to post a fallback image on Telegram when an RSS entry doesn't have an image:
let imageURL = Feed.newFeedItem.EntryImageUrl;
let noImage = 'no_image_card.png';
let replacementImage = 'https://yourlinkhere.jpg';
if (imageURL === "" || imageURL.indexOf(noImage) !== -1) {
imageURL = replacementImage;
}
Telegram.sendPhoto.setPhotoUrl(imageURL);
Important notes:
1. When using the above code, replace https://yourlinkhere.jpg with the URL to your image. Ensure that your replacement image is hosted on an external domain, preferably one that you own. You can also host your image on Dropbox or Google Drive as an alternative
2. This example code is using the RSS service's New Feed item trigger and EntryImageURL ingredient, referenced in the 1st line of the code:
let imageURL = Feed.newFeedItem.EntryImageUrl
If you Applet is using a different trigger, you find the relevant ingredient in the filter code editor by clicking triggers then finding the relevant image ingredient::
In this example, we're using a WordPress service trigger so when clicking the text on the right, Wordpress.anyNewPostWp.PostImageUrl would be copied and could then be pasted into the filter code editor to replace Feed.newFeedItem.EntryImageUrl with let imageURL = Wordpress.anyNewPostWp.PostImageUrl;
3. The above code uses the Telegram Send Photo action. If your Applet uses a different action Telegram.sendPhoto.setPhotoUrl(imageURL) will need to be updated.
The relevant action method can be found by clicking the available options on the right side of the filter code editor and then selecting the set photo option. In this screenshot the Applet is using the Twitter Post a Tweet with image action:
When clicking the text on the right, Twitter.postNewTweetWithImage.setPhotoUrl() would be copied and could then be pasted into the filter code editor to replace telegram.sendPhoto.setPhotoUrl(imageURL) with Twitter.postNewTweetWithImage.setPhotoUrl(imageURL).
By implementing this filter code, you can maintain consistent image presentation across all your RSS feed posts, even when original images are unavailable.