Tutorials

/

Dynamic Input Element: How Do You Use It?

With the Dynamic Input element, you can automatically create input fields suitable for different data types and allow users to easily save product information by selecting from existing options or entering new values.

‍

The “Dynamic Input” element is a flexible data entry element that allows users to select from available options or enter a new value as needed.
In this video, we’ll explore an example of how to use this element using the “Record of Purchased Products” scenario.
First, create the table structure on the screen. Then, use “New SQL Action” to create the “GetPurchasedProducts” action. Delete the table name, retype it, and press “Enter.” This will automatically add the correct schema name before the table name. Test it and save. Follow the same steps for the “GetFieldType” action.
Go to your page in the “UI Design” module. Add the “GetFieldType” action to the screen as the “Initial Action.” Add a “DynamicInput” element to the page. Type “Product Name” in the “Placeholder” field. Enable the “AllowClear” property. Select “Uppercase” from the “Formatter” field. Set the “DataType” field to “Action Result,” “GetFieldType,” “First,” and “ProductNameType.” Add another “DynamicInput” element. Type “Product Price” in the “Placeholder” field. Enable the “AllowClear” property. Set the “DataType” field to “Action Result,” “GetFieldType,” “First,” and “PriceType.” Add another “DynamicInput” element. Type “Date of Purchase” in the “Placeholder” field. Enable the “AllowClear” property. Set the “DataType” field to “Action Result,” “GetFieldType,” and “PurchaseDateType.” Add a “Button” element below. Type “Save” in the “Label” field. Bind the “Save Record” action to it. Select the table and choose all columns in the pop-up window. Define the “Price,” “ProductName,” “PurchaseDate,” and “Id” fields. Open the “Action Tree” section from the left-hand panel. On the button, follow these steps: “Add Action,” “onClick,” “Custom,” and “GetPurchasedProducts.” Drag the action added to the “Action Tree” onto the page by holding the icon next to it. Select “Table” and “Outputs,” then save.
When the application is tested, product information can be easily entered via the form created using “Dynamic Input”. When the user fills out the form and clicks the “Save” button, the entered product information is added to the table, and the list in the lower section is updated in real time. This ensures that input types are automatically determined for fields with different data types, providing the user with a simple and consistent data entry experience.