Forms


Forms allow you to utilize a simple UI for data entry to your blockchain ledger. It makes using a blockchain ledger even simpler by not having to worry 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 just these sample forms. You can create as many forms as you need for your app.

Import

You can export a created form to be used either later or on another app. To import a form, simply click on Import and upload your exported forms file.

Add New

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

  • 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; }

    • Identity (signed-in user) context is available as form.identity.
      eg. if(form.identity.attributes.RoleName!==’Admin’){ data.preventSubmit = true; }

  • Smart Contract Function Name (fcn): Select the smart contract function that is for the 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 need to 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 records type of Vehicle would be VIN because it is guaranteed to be unique. Uniqueness is not required across different forms because 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.

 

Note

When creating forms for custom smart contracts, provide arguments in the same order as required in the custom smart contract. The order of arguments for Xooa managed smart contracts is already defined.

  • Show Save as Draft: Checking this box will allow the app user to save their form in a draft stage before submitting.

  • 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 the form submission fails.

  • Submit Button Label: You may customize the label of the form submission button.

Embed

You can use the forms to gather data outside the platform.

  • Enable Submission: Enable the form to display outside the platform.

  • Embed Snippet: Use the provided snippet to embed the form in your own website.

  • Anonymous Submission URL: Share this URL with the end-user to enter data to your form.

 

Note

If the Identity form element is used in the form, the form cannot be embedded or used for anonymous form submissions.

View Token Plugin

The View Token plugin allows the platform owners to add new fields for metadata, customize the style thereby, providing a new spectacle to view the NFTs. It comprises of features such as NFT metadata, transaction history, available editions, social share, buy option and sort editions functionality.

Platform owners must reconfigure the View token form by changing the form type from form builder to Plugin.

  • Go to Forms -> click design on the View Token tile

  • Select Plugin in the Form Type

  • Select View Token from the drop down

  • Click Save