How to have a Form Automatically Set a Status (or any other related record)
Sometimes when you have a form that creates a new record like a Trip, you want some values of the new Trip to be set automatically, like who created the Trip and its status. You can do this by adding those properties be "Set Automatically" in the Fields section of the left panel when configuring your form.
However, if Status is not a text field, but rather another Collection that a Trip is related to, it can be a little trick to get the right Status record to be available on your form screen as "Current Status" so that it can be set automatically for new Trips created via the form. Here's how to do it:
- 1.With the component, such as a button selected, select the overflow menu.
- 2.Select Make List
- 3.With the List selected, select what it is a list of. In my example, I chose to make it a list of Statuses.
- 1.Select ADD ANOTHER FILTER
- 2.Select Select Column, and then select the field that you want to filter on. In this case, I am going to filter on the Name of the status.
- 3.The filter condition defaults to Is equal to. In this scenario, this is the condition that we want, so leave that as is.
- 4.Select the word Empty (not the drop down icon). This will allow you to type in what you would like the order status to be filtered to. Then type in the status that you would like to filter on. In this example, I used the status of Draft.Current Status will now show as Linked Data in the Available Data section of my New Trip Screen. Due to the filters that we put in place, that Current Status will be Draft.
- 1.Navigate to and select the page that your button is linked to.
- 1.If you already have the form that you are wanting to link the Current Status to, you can skip to step 3.2. If not, continue to step 3.1.2
- 2.Select the add component button, which is located on the left toolbar.
- 3.Select the Forms & Fields drop down
- 4.Select Form and place it on the screen.
- 5.With your Form select, Select which collection you want this form to use. In this case, I selected Trips.
- 6.Expand the Fields drop down. Status should show under Set Automatically. If Current Status shows as in the first image below, then you are finished.
- 2.If you had already set up your form before completing the earlier steps in this tutorial, you will see that Status shows Empty as in the image below, click the Status property to expand it.
- 3.Select the drop down.
- 4.Set the value to Current Status.
Now, whenever you make a new Trip, it will automatically be related to the Draft status