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

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, 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

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?

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(); 
}

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

Hi,

It’s strange :thinking:

When i try this, i have this result :
In form :
image

In form archive :
image

However I have data in “Form Data”, there are :
image

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(); 
    }

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

1 Like