Display a default picture in a image element if parent file is not an image

Hey all I’m stuck a little
I have a repeating group displaying some thumbnails prior to assigning them to a thing, however the repeating group is a list of files so not all of them will display in the image element.
For these files I want to have a standard file icon display however I cant figure out how
I cant do a 'if parent file is empty" as its not, what I need is a 'if parent file is not an image" or a hack

Here’s my suggestion when you’re working with a list of files. (A more elegant but cumbersome way is to have a table of “files” in the database, where you associate data with a file through additional fields, and have the file itself as one of the fields on the database entry).

If the set of files someone uploads is predictable, you can plan for it using a series of conditions that looks at the file type (ex. .csv) at the end of the file’s file name.

In the example below, I’m uploading an .ics file, which doesn’t show a preview (like a .png, .pdf would). You could extend the logic to .xlsx, .doc, etc.

I add “truncated from end to 5” to the expression to only look at the last 5 characters (Ex .docx). This minimizes the chances of getting a false positive.

This topic was automatically closed after 70 days. New replies are no longer allowed.