# Form designer: How to hide an attachment field according to the action name and if a file has been uploaded

**URL:** https://discuss.workflowgen.com/t/form-designer-how-to-hide-an-attachment-field-according-to-the-action-name-and-if-a-file-has-been-uploaded/277
**Category:** Form Designer
**Created:** [December 8, 2014, 9:24am UTC](https://discuss.workflowgen.com/t/form-designer-how-to-hide-an-attachment-field-according-to-the-action-name-and-if-a-file-has-been-uploaded/277 "2014-12-08T09:24:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![wfg-admin](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/wfg-admin/32/714_2.png) [@wfg-admin](https://discuss.workflowgen.com/u/wfg-admin)
#### Post date: [December 8, 2014, 9:24am UTC](https://discuss.workflowgen.com/t/form-designer-how-to-hide-an-attachment-field-according-to-the-action-name-and-if-a-file-has-been-uploaded/277/1 "2014-12-08T09:24:58Z")

</div>

### Issue

We would like the file attachment field in an eForm to be hidden in subsequent tasks after initial upload task if no file has been uploaded for that field. If a file has been uploaded, then it should stay visible.

Is there a condition/attribute one could use? We would combine it with a task name condition (hidden if `!task.name = "xxx" && ???`).

### Solution

In the field validation tab of the upload control, check `hidden`, then enter the code below:

```auto
this.CurrentWorkflowActionName !="INITIATES" && !REQUEST_ATTACHMENT.HasFile

```

Replace `REQUEST_ATTACHMENT` with the full ID of your upload field, and replace `INITIATES` with the action name where the file is uploaded.
