Database Design Documentation
How can we help?
Full Site Search

Default Values

Setting up a Default Value

In some cases you might need Ragic to fill out some of your fields with a Default Value, such as the current time or date, to save time while filling entries, as well as for error avoidance.

You can set default values to applicable field types by clicking the link next to the Default Value option in Design Mode, under Field Settings > Basic.

Variables Offered

You can use the variables offered in Ragic to generate a default value when an entry is being created or updated, or you can write a value to set as default that will populate this field in each new entry (in the case of setting a Free Text or Selection field).

Default Value Default Formatting Variable Example
Create date yyyy/MM/dd $DATE 2015/05/19
Create time HH:mm:ss $TIME 09:21:05
Create date time yyyy/MM/dd HH:mm:ss $DATETIME 2015/05/10 09:21:05
Create year yyyy $YEAR 2015
Create month M $MONTH 5
Create weekday E $WEEKDAY 2
Create user name Name LastName $USERNAME Jane Doe
Create user e-mail email@domain.com $USERID jane@initech.com
Last modified date yyyy/MM/dd #DATE 2015/05/23
Last modified time HH:mm:ss #TIME 09:32:06
Last modified date time yyyy/MM/dd HH:mm:ss #DATETIME 2015/05/23 09:32:06
Last modified year yyyy #YEAR 2015
Last modified month M #MONTH 5
Last modified weekday E #WEEKDAY 2
Last modified user name Name LastName #USERNAME Karen Moore
Last modified user e-mail email@domain.com #USERID karen@initech.com
Sequence 1,2,3 $SEQ 3

Regarding the variables related to "create", if default values are added only after record is already existing, the default values are triggered at the moment of adding or editing. If the field is empty, it will capture the editing user and editing time at that moment, rather than the actual creator and creation time of that record. To avoid this, it is recommended to manually populate empty values to fetch the original created information.

Inputting Your Own Formatting for Default Values

If you need customized formatting for default values, you can input text into the formatting box below the Default Value options, or can simply choose from the preselected formatting options. You have the option to set a custom date format for date fields as well.

Applying Formulas

You can also apply formulas to a default value. From the Form Page, enter Design Mode and check the box Interpret as formula below the Default Value field. Now add your formula directly into the Default Value field. For supported formulas in Ragic, please refer to the following documentation.

Notes

Formulas in the default value field will only be interpreted when the reference field is edited for the first time. Once the formula is interpreted, it will not be re-calculated in accordance with further edits. If you would like to have the default value re-calculated in accordance with the reference field value, please use formulas instead of adding formula as a default value. Formulas are explained in detail here.

For a similar reason, Ragic doesn’t support formulas in the default value field when one formula refers to multiple fields and you turn on autosave in a sheet. Because when autosave is activated, the formula will be triggered when one of the reference fields is auto-saved and will not be re-calculated when other fields are edited.

Using the Read Only Option

Fields with default values are often used in conjunction with the Read Only option to prevent users from manually changing the value.

Populate Empty Values

When your sheet already has entries and you would like to add a new field with a default value, or you would like to change an existing field type to a field type that has a default value applied to it, Ragic will not automatically populate the default values to existing entries according to the new configuration. Therefore, the new or newly modified field may remain empty. If you would like to have all empty values with a default value such as the most recent update, you can click on the Populate empty values button under the Default Value setting in Design Mode.

Step 1. Enter Design Mode to configure your default value

Step 2. Save your modification

Step 3. Under the Default Value setting, click on the set default value field. Then click on Populate empty values.

Once you click on the Populate empty values button, Ragic will start to populate the empty values in the background. This may take awhile depending on the number of records in your sheet. Feel free to navigate away from Design Mode if needed. There will be a pop-up notice in the lower-left corner of your screen once the process is complete.

You will then see the default value(s) autopopulated on the Form Page.

Setting Multiple Default Values for Select User or Group Fields

When setting multiple default values for select user fields, you can use '|' to separate the values. For example, entering 'Rex|Amy' as the default value, the field will automatically be populated with the default values: Rex and Amy.

You can also use '|' to separate multiple values for select group fields.

Note: If the user or group names themselves already contain the '|', You will need to use '%7C' instead of the original '|'. For example, to include the groups 'IT' and 'RD|Senior', it should be written as follows:

Top of Page Table of Contents

Start Ragic for Free

Sign up with Google