Skip to main content
You are here: Workflows

Form Updates

Overview

Form Updates are useful when we want to update/change parts of our form when completing a transition/transaction.

Status Updates: Default Form Updates

It is important to note that whenever you create a new transition/transaction, there will automatically be one form update in place. This form update is to indicate that the status of the form will change. Do not alter or delete this form update.

Configuring Form Updates: How to Configure an Example Use Case

Let's suppose that we have one field on our form called Full Name. When the user "moves onto the next section" we want to have another field that is updated to show a birth month using the dialog box in a transition.

To set up our form update, we need to do a few things first:

  1. We must create a form with 2 sections

    1. Name Section

      1. Contains a simple text field

        It may be valuable (at least for testing purposes) to create a single message validation so that you cannot move onto section 2 without entering a name.

    2. Birth Info Section

      1. Contains a simple text field

      2. It may be valuable (at least for testing purposes) to have a visible calculation set so that your birth info section will not be visible until you complete the transition (see the next step).

  2. Create a workflow transition to link the form update to

    1. It may be beneficial to name the transition something simple like "go to section 2"

    2. Have a designated status for when the user proceeds to section to like "section 2 in progress"

  3. Add a birth month text field to the dialog box associated with the transition

Now that we have this in place, we can navigate back to our Go to section 2 transition. We can see that in the form updates section, the status update has already been set. We can add a new form update by clicking the "+" button within the Form Updates section.

We want to create a form update that will update the Birth Month field on our main form, from the value that we enter in the dialog box during the transition. Within our New form-update window we have two values to set:

  1. Set* - in this case, we want to set the Birth Month field on our main form

  2. From* - in this case, we are going to set the Birth Month field on our main form from the value in our transition.

After we select our set* and from* inputs, we should see this in the form-update window, and then we will see a second form update on our workflow window.

Testing

Let's navigate to our form inbox, and create a new version of this form. Remember, that there was a visible calculation set so that we could only see the first section until we complete the transition to section 2. We are going to enter a Name, which will effectively prepare us to move to section 2 (Birth Info).

When we click the "Go to section 2" button, we will be prompted to enter a birth month:

We are now ready to proceed to viewing the second section of our form. When we click "OK" on our transition, we should expect to see that value populated in the main form, since we set our form field to update from the transition field. Immediately after clicking "OK" this is what we should see (without having to enter any additional information into our form):

We can see that the value that we entered during the transition auto-populated the field on our main form, effectively ensuring the success of our form transition.

Group to Array Form Updates

Similarly to how a user can perform a form update on a single field, Mirata has the capability to perform form updates to an array. Typically, the way this works is that there is an group/array in the dialog box contained in a transaction/transition, and there is an array on the main form that will be populated with whatever data is contained in the group/array in the transaction/transition.

Before diving into an example of how to structure this on a form, the most important thing to know is that when you append an array to an array the field names in both the origin array and the destination array must be named exactly the same. This is how the logic knows which fields to populate when appending something from the origin array to the destination array.

Group to Array Form Update Example

Suppose that on the main form, there is a inventory list where users can populate information about materials they see on a job site. Instead of having the list auto-populate from a backend data table/query, the list will become populated when the user adds an item to the inventory list via a action button on the form. Within the list there are only a few fields that a user would need to populate in order to have a complete list entry. The fields are as follows:

Field Name

Field Label

Field Type

Equipment_Name

Equipment Name

text

Equipment_Color

Equipment Color

text

Equipment_Qty

Equipment Quantity

integer

Equipment_Img

Equipment Image

image

A simple form containing this look will look something like the following:

Note: Add Enabled, and Edit Button properties have been disabled for this list.

Now that the list is set up on the form, the next step is to create a new transaction that will eventually house the group that will allow the user to add an entry to the inventory list via an group to array form update.

As shown above, a new transaction has been created called "Add Inventory Item" and the only change that was made as of now is that the "Show Button" has been turned off, since this transaction will be eventually tied to a button on the form.

The next step is to configure the dialog box in the transaction so that there is one group and all of the same fields (with the same name) inside that group. This is extremely important, given that for an group to array field update to work the fields within the group in the transaction must be named exactly the same. It is also important to note that while the group does NOT need to have the same name as the array in the form, it is often helpful to name it something similar.

Field Name

Field Label

Field Type

New_Inventory_Item

n/a

array (section/group)

Equipment_Name

Equipment Name

text

Equipment_Color

Equipment Color

text

Equipment_Qty

Equipment Quantity

integer

Equipment_Img

Equipment Image

image

When this is all put together, the dialog box should look something like the following:

Now that the dialog window is set up, we can connect the group in the transaction to the array on the main form using a form update. To perform this follow these steps:

  1. Click the "+" underneath Form Updates

  2. Select "Append to form field array" - the second option

  3. The first option to select something is for the "array" which is the array on the main form. Click the selection button next to the parameter, and select the entire array from the form (inventory_list)

  4. The second option is to select something for the "value" which is the group in the transaction. Click the selection button next to the parameter and select the group from the transaction (New_Inventory_Item)

  5. Click "OK"

When this is complete, the form update window should look something like the following:

So, in summary, we are appending the value of the New_Inventory_Item to the inventory_list, both of which are groups/arrays.

The last step is to connect this transaction to a button on the form, such that, when the button is clicked, the user can enter the details and add an item to the inventory list (perform the array to array form update)

To do this, simply add a Workflow Transition Button to the form, and in the control properties select the "Add Inventory Item" transaction which had previously been created and configured. It often helps to give the button a name and label which in this case will be "add_inventory_button" and "Add Equipment" respectively.

Now, this can be tested by navigating to preview mode, and clicking the new button, entering the information in the dialog box, and watching the list item appear on the Inventory List on the form.