Declare Hidden Variable in InfoPath 2013/2010

This InfoPath SharePoint tutorial explains, how we can declare a hidden variable in InfoPath 2013/2010 form. We can use hidden variables to keep track of any value or any flag according to the requirement in SharePoint.

Declare Hidden Variable in InfoPath

There are two approaches we can declare a hidden variable in InfoPath.

First Approach:
Put a textbox control from the controls section from the Home tab in the Ribbon. Once you put a textbox, the textbox will appear in the form and a field will be added into the Fields list.

Then delete the textbox from the form, remember if you will delete the field from the form it will not delete the field from the field list. So you can right-click the field and the Field Properties and then you can set values in Field and Group Properties dialog box. This field will work as your hidden variable.

Second Approach:
From the Fields, click on Add Field as shown in the fig below:

Declare Hidden Variable in InfoPath
Declare Hidden Variable in InfoPath

Then in the Add Field or Group dialog box give the display name for the field, Name and you can also choose the Data Type.

Also if you want to give some default value then you can set.

Then click on OK. This will also work as a hidden variable. Appreciate your comment if something is wrong or you want to suggest something.

You may like following InfoPath SharePoint tutorials:

I hope this will be helpful to declare Hidden Variable in InfoPath 2013/2010 in SharePoint 2013/2010.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

>