Filecheck in repeat always the same

I’ve created a repeat on the server side which loops through database records. In the repeat I have “if File Exists” which checks {{ID}}.mp3 with {{ID}} from repeat.
I have files which are named the same as the records ID. Like 2683.mp3.
The funny thing is, if the first file check in the repeat is true, all others are too. And if its false, all are false.

grafik

In the browser it looks like this. So in this case, only 2683.mp3 is on the server.
grafik

As you can see in the last picture, The ID is being recognized the way it’s ought to. Is there a bug or did I miss something?

Thanks in advance!

@patrick will check this.

1 Like

Thank you :slight_smile:

Just a thought based on the screenshots.
Why don’t you try this?
In the query that is used as an expression for the repeat, retrieve all the records that hold the .mp3

So intead of cheching (in the file exist) the ‘{{ID}}.mp3’ you will be checking the entire file name (something like ‘{{filenameFromDatabaseRecord}}’) which eventually will be holding all the mp3 files.

Thank you!

1 Like

Thank you for investing your time in my problem but it’s kind of the other way around.
The idea is to not store the filename in the database. Just a Boolean which indicates if a files exists for this entry. So whenever the table is being loaded, all records from the table page are checked for a linked file. In the table itself, a download button is only displayed when the database says true. The download link is the ID from the table plus the mp3 extension.

Right now, the filecheck happens from the client side which sends the request to the server and the server reacts for each record:


It works, but now I have more records per page and this increases the rendering time.

May sound trivial but have you tried just displaying /predigten/{{ID}}.mp3 in the same you you display ID to check it is in the correct format?

1 Like

Actually that’s not a bad idea at all! Just store the path as value and set the output! I’m gonna try that tomorrow. Have a wonderful night you all!

Ok so I set the path with the ID as value and enabled output. That’s the result:
grafik

So putting the ID from repeat in context does work! Hence, something with the file check has to be wrong.

Yes indeed, that’s why i wrote Patrick will check it tomorrow :slight_smile:

1 Like

Thank you! :slight_smile:

I identified the problem, will be fixed in the next update.

3 Likes

Perfect thank you I’m already looking forward to the update!

2 Likes

OK just tested it out. Works as it should. Thank you again, that decreased my loading time to a fragment!

1 Like