Set Default Value - Query Worksheet
When creating records, if some data in the current worksheet or other worksheets already existed, you can query a specified worksheet using search conditions and write the queried data into fields.
This method can be used to set default values for regular fields, relationship fields, and subform fields.
Use Cases
1. Setting default values for regular fields
Example: When submitting a reimbursement application, the recipient's bank and bank account number automatically default to the information used in the applicant's previous application.
1). Configure dynamic default value for the "Bank Card" field by selecting "Query Worksheet"
2). Configure the worksheet to query and set query conditions
-
The query searches all data in the worksheet, not just data visible to the current user.
-
If multiple records match the query conditions, you can choose to:
-
"Get the first record"
-
"Do not get anything"
-
Handling empty dynamic values in filter conditions
3). Write query results to the field
If records are found, the corresponding field value from the record will be written to the current field.
Implementation Effect:
2. Setting default values for relationship fields
Example: When creating an order, after entering a phone number, the system can query the Contacts worksheet for the corresponding contact. If found, the contact record is automatically related.
1). Configure default value for the "Contact" field by selecting "Query Worksheet"
2). Configure query conditions
For relationship fields, you only need to configure query conditions (no need to specify the worksheet to query).
Example condition: Find records in the Contacts worksheet where the phone number matches the one entered in the current record.
If records are found, the contact record is automatically related
Implementation Effect:
3. Setting default values for subform fields
Example: During equipment inspection, when creating an inspection form:
-
After entering the equipment name,
-
The system retrieves corresponding inspection items and methods (multiple records) from the "Inspection Details" worksheet,
-
These are automatically populated into the subform (Inspection Details) of the current inspection record.
1). Configure dynamic default value for the subform
"Other Field Values" option is unavailable for subform fields.
2). Configure query conditions
-
Select to query data from the "Equipment Inspection Details" worksheet.
-
Can set limits on number of records to query:
-
Maximum 500 rows.
-
If using card display mode: maximum 50 records supported.
-
3). Map to subform fields
To write queried data into the subform, configure field mapping:
-
Left side: Fields in the subform
-
Right side: Fields in the queried worksheet
Implementation Effect: