Hidden Field Values
Pass pre-defined values with hidden fields on Forms or Action Buttons
Last updated
Pass pre-defined values with hidden fields on Forms or Action Buttons
Last updated
Noloco supports two types of fields:
visible input fields that the user fills in, or
hidden fields with pre-defined values when the form is submitted.
Hidden field values allow you to ensure specific data will always be added to a record. Two places you can make use of Hidden values are
Forms
Action buttons
You can pass either a static value or a dynamic value to a hidden field.
Examples of static values include pre-determined text, numeric or date data values that do not change.
e.g Whenever a new Loan Application record is created by a Borrower (User) via the '+New Loan Application' button to always pass a status value of 'Pending'.
Examples of dynamic values include passing values dependent on
The 'Logged in User' and/or
Relative Date/Time values.
This ensures that any value related to the logged in user submitting the Form or Action button or a relative date/time value will be added to the target record.
e.g Whenever a new Loan Application record is created by a Borrower (User) via the '+New Loan Application' button to always pass the id
of the Borrower (Logged in User) to the Borrower field.
and/or
Set the hidden value for 'Review Deadline Date' as NOW
Hidden values enables you to link Users to Records 👥 🔗
Using a hidden value to pass the logged in User's ID to the linked User field on the target record creates a link. If you have Permissions setup to only allow users to access record(s) they are linked to this is a very important feature to setup in your Forms and/or Action buttons so they can access the records they are creating or updating.
In both examples it will ensure the correct data is passed through to the record without putting the onus on the User that is interacting with the form. Reducing the number of steps for the User can reduce the level of friction from your User's experience.
Note: The field will not be displayed to the end user on the Form or the Action Button.
Where to access hidden values in Forms
Navigate to your chosen Collection to locate the respective Form
Select the +New [Colllection] button
When the form is open, enter into edit mode (Cmd+e) or (Ctrl+e)
From the configuration view, select the field you wish to configure a hidden value for
Navigate the the Hidden Value area
Pass either A) a static value or B) a dynamic value
For static values enter (text, number, date etc.) or choose (single selection option) the value the dialog.
Note: Keeping in mind the permitted data format for the target field
For dynamic values press the (+) button and access the Logged In User attributes you wish to pass through the field as a hidden value.
Note: Choosing a related User Field that matches the target field
If you have setup a User List and you wish to pass the id of the logged in User to the field on your form, do not use the Noloco ID. Instead use the linked field ID that matches that of the field you're configuring a hidden value for. This field should be available in the Logged in User attributes returned behind the (+) button.
Example being: If you're passing the ID of the Borrower (user) to the Borrower field on the Loan Application form. You must select Logged in User > Borrower> Id and NOT Logged In User > id
Screenshot example below
Note for Builders & Admins 👀 When choosing a Hidden value, the field will disappear from the Form. Make sure to test out the Form containing the hidden value as a number of different Users. Check to see the correct hidden values are passed within the record the Form has created.
Where to access hidden values in Action Buttons
Navigate to your chosen Collection you wish to configure an Action Button for
Enter into edit mode (Cmd+e) or (Ctrl+e) and click anywhere along the header of the page to open the view configuration sidebar
From the configuration sidebar, navigate to the button section
Choose to create a Collection button or a Record button
During the creation of your button, choose which fields you wish to include for the action
Select the field(s) you wish to configure a hidden value for
Navigate to the Hidden Value area
Pass either A) a static value or B) a dynamic value
For static values enter (text, number, date etc.) or choose (single selection option) the value the dialog.
Note: Keeping in mind the permitted data format for the target field
For dynamic values press the (+) button and access the Logged In User attributes you wish to pass through the field as a hidden value.
Note: Choosing a related User Field that matches the target field
In the above screenshot example the 'Mark as Completed' Action button is updating the Application status field value to Completed. All without requiring the User to input that field.
🔘 Learn more about Action buttons here
Default Values will remain visible on the Form view or Action Button view. It will pre-select data that the User is likely to choose by default, attempting to reduce friction in the User Experience.
However, it still gives the User the option to amend the selected input default field value before submitting the form or Action button.