In the App Builder you can create a few different kinds of screens. Multi-screen loops will allow you to repeat multiple screens (Labels Above, Labels Left, or other looped screens) as many times as necessary. It allows you to create a list within a list (or a table within a table) and capture further information on the data you have already captured.
Multi-screen loops allow you to do two main things:
- Capture a list of items which then has another list of items under them.
For example, imagine a you are a moving company. You want to capture all of the furniture items in all rooms in a house. You have two lists here: one for rooms and one for furniture in each room. Each home will have a different number of rooms and each room will have a different number of furniture items. You need the ability to add as many rooms as necessary on each job with as many different furniture items as needed.
- To insert a conditional screen based on data captured about an item added to a list.
Conditional branching allows you to set up a screen that either will show up or will not show up based on entering a certain value in a previous field on a previous screen.
For the moving company, they might want to capture additional information about a damaged piece of furniture; however, they will only want to see that screen after they have noted that an item is damaged.
Or, an inspector wants to capture unique information about each item that fails an inspection. She wants to enter a description of the damage, actions to remedy it, and capture some pictures of it. Most items pass the inspection, so the failed item screen only needs to show if you indicate that it has failed.
Multi-screen loop tutorial
Using the moving company scenario, let's take a look at how to create a multi-screen loop.
- Launch the App Builder for an existing App or create a new App.
- Click + Add Screen and label it "Room."
- Hover over the Room screen and click the Loop icon. You can learn the basics about looping screens here.
- Now you'll need to create the key field. The key field would be the defining element of your list such as Item Number or Name, Labor Code, or Employee Name. Currently you can use Short Text, Number, Drop Down, Date, Time, and Barcode fields as the key field type. In this example, you would use something like Room Number, Room Description, or Room Location as the key field because the room detail is the key value for any information you add about the room. Click Done once created.
NOTE: You will notice that once you create your key field, the App Outline will display Looped screens differently than others. The key field is separated to form a mini screen. This is similar to what you will see on your mobile device as you must first enter information into the key field prior to completing any additional information about the key field value. The entire loop will be outlined to show you what fields and screens can be repeated.
- Click into the main Room screen. After you enter a room number, you'll want to be able to collect information on as many furniture items as needed. This will require another loop screen to appear after entering the room number. Hover over the screen and click the loop icon.
- Add your key field. This should be "Furniture Description." After clicking Done, you can rename the screen as needed.
Your App Outline should now show you a loop screen within a loop screen. You have two key field values, Room Number and Furniture Description. You can add as many Furniture Descriptions to a single room number. You can add as many Room Numbers to a single submission (moving report). Also note that each looped scenario within a multi-screen loop will be outlined.
- Click into the screen that says "Room Furniture." Drag and drop any fields from the field palette on the left into your app. These will be the fields that you fill out about each piece of furniture. You can rename this screen as needed.
- Once you are finished making any additional changes to your app, Publish to device to see it in action!
Adding a Conditional Screen
Let's add a screen that only appears if an item is marked "Yes" in a "Damaged" field.
- Launch the App Builder and click to open the Room Furniture screen.
- Add a Drop Down field and label it "Damaged?" Add "Yes" and "No" as the values for the Drop Down.
- Click the + Add Screen button to create a new screen. Label the screen "Damaged Furniture." If the screen does not appear in the loop with your Room Furniture screen, drag and drop the screen inside of the loop.
- Add some fields to collect data about the damaged piece of furniture.
Notice that Damaged Furniture is in the same loop as Room Furniture. This means that you will enter information about Damaged Furniture, if the item is damaged, prior to returning to the Room Furniture key field.
- Next, click to open the screen settings and expand the Screen Condition(s) tab.
- Click to add a new screen condition. You will want the Condition Screen to be the screen where you are adding information about the furniture. The Condition Field will be the "Damaged?" field as this will determine whether or not the Damaged Furniture screen appears. You can read more about conditions here.
Now the Damaged Furniture screen will only appear if "Yes" is selected as the response to "Damaged?"
- Publish to device when you are finished making any changes in the App Builder.