Skip to main content

NIM

Step 7: Collect user input and work with variables (tutorial)

So far, we've only added read-only items to our form. In this step, we'll introduce items that collect data from the user, and then we'll store that data in variables. Variables are, in a sense, the "engine" of NIM apps. They let us store state and get data where it needs to be.

  1. We'll add 3 Input Text items to our form in consecutive rows, and set each item's column width to 6.

    2023-10-16_13-23-12.jpg
  2. We'll set the properties of the first input text item as follows:

    2023-10-18_14-40-10.jpg
    • label mode: float

    • variable name: new_FirstName

    • label text: First Name

    • margin trbl: __3_

    • minimum length: 3

    • required: yes

    • validation message: User must have first name, with a minimum of 3 characters

    Tip

    The value that the user inputs into this field will be stored in the new_FirstName variable. As we'll see shortly, we can bind this variable to other objects in our app.

  3. We'll set the properties of the second input text item as follows:

    2023-10-16_14-13-17.jpg
    • label mode: float

    • variable name: new_MiddleName

    • label text: Middle Name

    • margin trbl: __3_

  4. We'll set the properties of the third input text item as follows:

    2023-10-16_14-14-35.jpg
    • label mode: float

    • variable name: new_LastName

    • label text: Last Name

    • margin trbl: __3_

    • minimum length: 3

    • required: yes

    • validation message: User must have last name, with a minimum of 3 characters

  5. We'll click Save to save our progress so far.

Next: Step 8: Finish the first form