It is sometimes necessary to hide or unhide controls and blocks on an eForm based on the contents of a form, or on the user account that is logged in. This is often used to disable areas that are only available to administrators or other power user group.
The following steps will show you how to make blocks collapse by using a formula:
- Open an eForm in the Designer
- Select the Blocks tab
- Click Edit button in Advanced Formula Bindings
- Put a formula such as ISBLANK([Tickbox]) into Collapsed? field to make sure the block will collapse or open in different situations
- Close the window
- Click Preview
Using a Button
Button controls can alter the state of a Record’s data fields using the Change Field Values Task type.
- Select a Button control you wish to edit, or add a new one using the Insert section of the sidebar.
- Under the Events section of the Button’s Properties panel in the sidebar, click Edit
- Select Change Field Values from the dropdown list in the pop-up window and click Add to add this task to the button’s event. Click the newly-added Change Field Values item in the Tasks list and click Edit
- The Task window that appears allows you to specify what formulas to apply to each field. Leave the Alternate Record section blank so that the Task will edit the current record, and use the Change Field Values section to define a formula to assign to each field you wish to edit. In this example, we’ll just be setting the Tickbox field to TRUE.
- Close the pop-up windows and use the Preview panel to confirm that the button now sets the visibility of the control or block.
Remember that this a control/block level setting. The actual data will not be effected. The main unexpected consequence of this is that just because a control is hidden doesn’t mean that users cannot access it. This data will be available in a tabular report.
To prevent users from accessing this data you will have to use:
- Column level permissions
- Child forms with filter permissions