Forms


Forms allow you to utilize a simple UI for data entry into your blockchain ledger. It makes using a blockchain ledger even simpler by not worrying about the structure of data. When your app is deployed, sample forms will be created for you to use, but you are not limited to these sample forms. You can create as many forms as you need for your app. The admin can view the following categories in the forms section of the application:

  • System Customizable: Provides the forms which are available by default solution template and the admin can manage the forms as per the requirement.
  • System (Change Not Recommended): Provides the forms which are available by default solution template, but it is recommended not to make any changes to the forms.
  • Custom: The admin can add new forms or import forms to the custom based on the requirement of the form.

Add a New Form

You can utilize the inbuilt form editor to create or edit a form according to your needs.

  • Name: This will be used to identify both the form and the type of records added or modified by the form into World State.

  • Form Type: Select the form type that you wish to design the page with. Based on your selection, the form components will be exposed. There are two form types to choose from:

    1. Form Builder
      • Design Form: Drag-and-drop form elements from the panel on the left or rearrange form elements already on the form canvas to change the layout. You can see the preview of the form immediately.
        • For adding nested data, use dot(.) operator in API section of a form element. eg. properties.weight, details.Name, business.address.city, residence.address.city
        • To prevent form submissions upon certain conditions, set data.preventSubmit = true. This can be used in the JavaScript section of any form element. eg. if(data.status!==’Approved’){ data.preventSubmit = true; }
        • To prevent form submissions under certain conditions, set data.preventSubmit = true. This can be used in the JavaScript section of any form element. eg. if(data.status!==’Approved’){ data.preventSubmit = true; }
      • Form Options
        • Success Message: You may customize the message shown to the app user when the form is successfully submitted.
        • Failed Message: You may customize the message shown to the app user when form submission fails.
        • Submit Button Label: You may customize the label of the form submission button.
      • Advanced Settings: WARNING: DO NOT CHANGE WITHOUT XOOA SUPPORT
        • Web3 Operation: Select the check box to allow only Web3 users to access the form.
        • Smart Contract Function Name (fcn): Select the smart contract function for form submission.
        • Smart Contract Arguments: Map each function argument to form fields. You may use any (or multiple) form element(s) as a value or use the special keyword: FormData to save the entire form.
      • Key For XLDB based apps, you must designate a form field that serves as the unique Key for the specific type of records managed by this form. You may use any form element to act as a key, but you can’t change the key once a form is saved. An example of a good form field Key for a records type of Vehicle would be VIN because it is guaranteed to be unique. Uniqueness is not required across different forms because the form name is always part of the Key as can be visible when observing data entered using the form in World State.

      • Value You may use any (or multiple) form element(s) as the value for the key or use the special keyword: FormData to save the entire form.
    2. Plugin The Plugins form type can be used to set up the data rendered on the app. The user can select one of the following plugins based on the requirement.
      • HTML: You can write HTML text here. The HTML format entered here will be rendered on the app. The following plugin settings can be provided based on the requirements.
      • Content
      • CSS
      • Script
    • Drops Inventory: Drop admin can check inventory information like unsold and sold tokens in a drop. The following plugin settings can be provided based on the requirements.
      • Form Name
    • View Collection: This can show collection details. It will show all the tokens belonging to the selected collection. The following plugin settings can be provided based on the requirements.
      • Select Page
    • Master Token View: This is the original copy of the token which is created and not minted on any chain. The following plugin settings can be provided based on the requirements.
      • Select Page
    • View Token V2: This can be used to show token information, customize values and fetch data through API in a plugin. Also, more sections can be added with a customized structure. The following plugin settings can be provided based on the requirements.
      • Public Key
      • Content
      • CSS
      • Buy Button Text
      • Trade Button Text
    • Swap: This can be used to perform a swap.

    • Accept Swap: This can be used to accept a swap.

    • Promise Table: This can be used to claim a promise for a token. The following plugin settings can be provided based on the requirements.
      • Promise data
      • Default confirm modal message
      • Hide claimed promise
      • Label Settings
    • Counter Swap: This can be used to counter a swap.

    • View Challenge: This can be used to show challenge information, customize values and fetch data through API in a plugin. Also, more sections can be added with a customized structure. The following plugin settings can be provided based on the requirements.
      • Content
      • CSS
      • Button Text
    • Connect And Transfer: This can be used to transfer custodial Token from web2 user to wallet. The following plugin settings can be provided based on the requirements.
      • Message
    • Advanced Settings: (WARNING: DO NOT CHANGE WITHOUT XOOA SUPPORT)
      • Web3 Operation: Select the check box to allow only Web3 users to access the form.

Import Form

The admin can import the created forms based on the requirements. The admin must follow the below steps to import a form.

  • Navigate to the Forms page and click Import.
  • Click Browse or Drag & Drop the form
  • Click Import to import a form.

     

    Once the file is imported, it is available in the Custom section of the Forms page.