How to add a server side validate step on a repeat element

I am having some issues adding a server side validate step on an element.

Its an input inside a repeat, for uploading files, i need to validate that the file name does not already exist on the server.

Steps
Database Connection
Repeat
Validate Data

Here are the settings you can not see
Expression

{{'/african-and-indian-ocean-holiday-images/header-slideshows/'+slideshow_image_name.lowercase()}}

Linked Field

record_for_multi_insert[{{$index}}][slideshow_image_name]

What this is doing is kind of working but not exactly, if i upload one image that i know to be a duplicate name, it processes than adds a message under the one field that is already exists in the database and it does not upload or save the name into the database, so perfect.

If i upload 2 images and both are duplicate, it adds the error to only the first input field about already existing in the database and neither upload or get added to the database, so I could kind of live with that, but would be better if both fields told us they were already in the database.

The issue really starts if I upload input 1 as a unique image and input 2 as a duplicate image, the error comes up on input 2 only as it should, however image 1 is uploaded to the server and the value is saved to the database, which I would rather the entire form fail not just one part of it.

I assume I have just entered in incorrect values into the expression or Linked Field possibly, but if someone could try advise please.

Community Page
Last updated: