8
Views
10
Comments
Solved
Validation does not fire for empty attachment list on first load
Question

I implemented a validation rule to ensure that when the Attachment List is empty, a validation message should be displayed.

However, an unexpected behavior occurs on the first attempt, the validation is not triggered even though the Attachment List is empty. The validation only starts working after an attachment is added once, at which point the validation behaves correctly (as shown in Figure 3).

The validation condition itself is correct, so this appears to be related to how OutSystems initializes or evaluates the Attachment List on the first load. We are unsure why the attachment validation is not executed during the initial state.

Could you please help us identify the root cause and suggest a proper fix for this issue. 

Thank you 




attachfile .png
attachfile_validate_incorrect.png
assignment.png
UserImage.jpg
sahatsawat kthasattapich
Solution

Thank you so much, 

but I have identified the root cause of the issue. Once we removed our custom Input_Wrapper block that uses Placeholders, the upload widget started validating correctly.

However, I still do not fully understand why the Input_Wrapper block causes this problem and how wrapping the upload widget inside a placeholder-based custom block interferes with the validation behavior.

InputWrapper.png
styleInputwrapper.png
2025-12-01 10-27-43
Sherif El-Habibi

Hello,

If it’s okay, could you share the OML or a sample of the implementation ?

UserImage.jpg
sahatsawat kthasattapich
Solution

Thank you so much, 

but I have identified the root cause of the issue. Once we removed our custom Input_Wrapper block that uses Placeholders, the upload widget started validating correctly.

However, I still do not fully understand why the Input_Wrapper block causes this problem and how wrapping the upload widget inside a placeholder-based custom block interferes with the validation behavior.

InputWrapper.png
styleInputwrapper.png
2021-09-06 15-09-53
Dorine Boudry
 
MVP

as has been asked twice, share an oml, and people can take a look at what exactly you are doing.

Right now, we have no idea of how you implemented that validation, of what elements are on that screen, of what you mean by "at first attempt" and "on the first load"

UserImage.jpg
sahatsawat kthasattapich

Sorry for the late reply.

I’m not able to share the original OML, but this is a demo where I implemented the attachment validation in the same way as in the original OML. However, in the demo it works fine, and I’m not sure why the behavior is different.

ValidateUpload.oml
2025-12-01 10-27-43
Sherif El-Habibi

I can't seem to be able open the module, and you also mentioned that it’s working in the demo, so the issue seems to be in the actual app itself. Anyway, here’s a simple assumption maybe right, maybe wrong but you can check it in your module.

The scenario is like this: when you click submit the first time, no validation happens. After you upload an attachment and click submit again, the validation message appears. The only thing I can take from this is that the condition might be swapped somewhere, so maybe double-check the logic you used. I also assumed from your screenshot that the validation message only appears after the first attachment is uploaded, which kind of supports this theory that a condition may be swapped. 


2025-11-18 06-38-47
Deepak Raj M

Hi @sahatsawat kthasattapich could you please share your OML file? That will make it easier to check and solve the process. 

UserImage.jpg
sahatsawat kthasattapich

Thank you so much, 

but I have identified the root cause of the issue. Once we removed our custom Input_Wrapper block that uses Placeholders, the upload widget started validating correctly.

2023-10-16 05-50-48
Shingo Lam

Hi @sahatsawat kthasattapich ,

On the first initialization, the Upload.Valid is always true. I don't know the logic of your validation, but I think you should change your assignment below by Upload1.Valid = not Attachment List empty

UserImage.jpg
sahatsawat kthasattapich

Sorry for the late reply.

This is a demo where I implemented the attachment validation in the same way as in the original OML. However, in the demo it works fine, and I’m not sure why the behavior is different.

ValidateUpload.oml
2023-10-16 05-50-48
Shingo Lam

Great news, you have figured it out yourself. 
So you know that with oml, its easier for us to check your issue.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.