# How can I hide data element (and field) from the follow up form and the form archive?

**URL:** <https://discuss.workflowgen.com/t/how-can-i-hide-data-element-and-field-from-the-follow-up-form-and-the-form-archive/1086>\
**Category:** Form Designer\
**Created:** [June 21, 2018, 11:11am UTC](https://discuss.workflowgen.com/t/how-can-i-hide-data-element-and-field-from-the-follow-up-form-and-the-form-archive/1086 "2018-06-21T11:11:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![marinam](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/marinam/32/322_2.png) [@marinam](https://discuss.workflowgen.com/u/marinam)\
**Post date:** [June 21, 2018, 11:11am UTC](https://discuss.workflowgen.com/t/how-can-i-hide-data-element-and-field-from-the-follow-up-form-and-the-form-archive/1086/1 "2018-06-21T11:11:43Z")

</div>

Hello,

My process form contains Licence Key field that is confidential and shouldn’t appear in the follow-up form and form archive.  
It should be visible only for participants while completing their actions.

I found some info in this topic [here](https://discuss.workflowgen.com/t/omit-or-hide-form-field-response-in-the-form-archive-file-in-email-notification/993), but unfortunately I haven’t found this information applicable in my process.

Could you please provide some instructions on how to hide data element?

Thank you in advance,  
Marina

---

<div class="post-metadata">

**Author:** ![qpomarel](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/qpomarel/32/262_2.png) [@qpomarel](https://discuss.workflowgen.com/u/qpomarel)\
**Post date:** [June 21, 2018, 11:31am UTC](https://discuss.workflowgen.com/t/how-can-i-hide-data-element-and-field-from-the-follow-up-form-and-the-form-archive/1086/2 "2018-06-21T11:31:15Z")

</div>

Hello Marina,

I think you can hide field after send button click.

For this solution, you need to add an event on submit button click.  
There is an example here : [Form designer: How to add custom code on the submitButton event in the ASP.NET server side code-behind?](https://discuss.workflowgen.com/t/form-designer-how-to-add-custom-code-on-the-submitbutton-event-in-the-asp-net-server-side-code-behind/247)

Example of result :

```
protected void Page_Load(object sender, EventArgs e) 
{ 
    base.Page_Load(sender, e); 
    submitButton.Click += new EventHandler(HideFields); 
	saveAsDraftButton.Click += new EventHandler(HideFields); 
} 

protected void HideFields(object sender, EventArgs e) 
{ 
	FIELD_TO_HIDE.Visible = false;
    this.SaveFormData(this.FormData, true); 
    SubmitToWorkflow(); 
}
```

---

<div class="post-metadata">

**Author:** ![marinam](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/marinam/32/322_2.png) [@marinam](https://discuss.workflowgen.com/u/marinam)\
**Post date:** [June 21, 2018, 12:24pm UTC](https://discuss.workflowgen.com/t/how-can-i-hide-data-element-and-field-from-the-follow-up-form-and-the-form-archive/1086/3 "2018-06-21T12:24:05Z")

</div>

Hi Quentin,

Thank you very much for quick response.  
I implemented the code in the process, referring to field ID that I wanted to hide, but field is still visible in the form archive. It is hidden from follow-up form because I unchecked “Show the data in the follow-up forms”.  
But I still can see it in the form archive.  
Is there anything else I can do?

Thanks again,  
Marina

---

<div class="post-metadata">

**Author:** ![qpomarel](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/qpomarel/32/262_2.png) [@qpomarel](https://discuss.workflowgen.com/u/qpomarel)\
**Post date:** [June 21, 2018, 1:05pm UTC](https://discuss.workflowgen.com/t/how-can-i-hide-data-element-and-field-from-the-follow-up-form-and-the-form-archive/1086/4 "2018-06-21T13:05:57Z")

</div>

Hi,

It’s strange 🤔

When i try this, i have this result :  
In form :  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/workflowgen/original/1X/ea5b7d785412dd2cedc7a13b555f8af9be582062.png)

In form archive :  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/workflowgen/original/1X/295e5fa4397543b928a6486dfff9fd2b8a4bcf7f.png)

However I have data in “Form Data”, there are :  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/workflowgen/original/1X/043cf6d6459a4a873c7d0256959d8a9b5cc58efa.png)

If it is the problem, it’s possible to hide “FORM\_DATA” to users.

Code :

```
	protected void Page_Load(object sender, EventArgs e)
	{
	    base.Page_Load(sender, e);
	    submitButton.Click += new EventHandler(HideFields); 
	    saveAsDraftButton.Click += new EventHandler(HideFields); 
	}
	protected void HideFields (object sender, EventArgs e) 
    { 
    	DEMANDE_DESCRIPTION.Visible = false;
    	DEMANDE_REQUIS.Visible = false;
        this.SaveFormData(this.FormData, true); 
        SubmitToWorkflow(); 
    }
```

---

<div class="post-metadata">

**Author:** ![marinam](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/marinam/32/322_2.png) [@marinam](https://discuss.workflowgen.com/u/marinam)\
**Post date:** [June 21, 2018, 1:47pm UTC](https://discuss.workflowgen.com/t/how-can-i-hide-data-element-and-field-from-the-follow-up-form-and-the-form-archive/1086/5 "2018-06-21T13:47:05Z")

</div>

Hi Quentin,

Thank you very much for this detailed instructions!  
I’ve updated the code and now it works.

Thanks a lot!  
Best regards,  
Marina
