You must add this query manually when you use forms generated from tables or you generate forms manually.įill in the form and click Submit to create a new record in your database. When you generate a Form using a resource, Retool also generates a query, form1SubmitToProducts, to insert new records into the database when the form is submitted. This can be useful if fields need to accept null values or you need to modify your form to more closely match your data. You can also modify input properties of JSON Schema Form components by updating the type field. You can also enable automatic validation by enabling Live validation in the Inspector. Select the Image URL input and change the pattern to URL so invalid URL formats produce a validation error.įor JSON Schema Form components, you define validation rules in the JSON schema. Validation supports options such as pattern matching (URL, email, or regular expression) and minimum and maximum lengths. ![]() Validation for a selected input is configured in the Validation section of the Inspector. Each input component supports several validation options. Validate submissions įorms can check the validation status of inputs-enable Validate inputs on submit in the Interaction section of the Inspector. Update the labels for each input and set the fields required to be Name, Created at, Updated at, and ID fields.Ĭlick Generate form to create the new form.Įach input is generated with a value for form data key-shown in the Advanced section of the Inspector-that corresponds to the column name from the table. You can also change the generated input type or label, and whether the field should be required. This is useful if you don't want users to provide certain information, such as IDs or timestamps. You can uncheck individual columns to exclude them from the form. For instance, an Integer column results in a Number Input. Retool evaluates the type of each column to determine the input type to use. The form generator displays the column names from the selected table and the generated input fields. ![]() New forms are initially empty so you need to add inputs or generate a new form.Ĭlick Generate form, then select the onboarding_db database and products table. Next, drag a Form component onto the canvas and place it next to the table. Retool automatically adds a table ( table1) and query ( query1) to your app to display products table records from the sample onboarding_db PostgreSQL database.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |