App Switches

We have seen how to create and update Object (instances) from within Processes. We have seen how Objects (instances) can be selected from Lists, displayed within Object Views, and passed as input parameters to Processes.

In this tutorial, we will look at some uses we can make of True/False fields of an Object (instance) in configuring the App to adapt its behaviour depending on attributes of the instance.

Let us refer to values of true/false fields as flags.

1. Making List Item display conditional on fields

One thing we can do is use flags in configuring a List Item widget which renders differently if that flags is true or false.

In our example patient object so far, we have defined a small number of fields, including one True/False field called allergic.

Suppose we want to show not only name and date of birth, but also to indicate clearly those patients who are allergic.

We can do this by making an element of the List Item Widget appear for a patient only if the patient is allergic.

Read about how to do this in Conditional List Item Configuration

2. Filtering List with respect to True/False field

A second thing we can do with flags is use them in filtering lists.

Perhaps we don't want a list containing "allergic" and non-allergic patients.

Perhaps instead we want to partition our patients into two lists.

We can do this by defining two patient lists and filtering them appropriately.

Read how to Filter a List by True/False field.

3. Making which actions appear dependent on fields.

A third thing we can do with flags is use them to condition whether certain Actions appear or not.

In our sample App, we have an Actions component.

Currrently, we are using it as the destination of the Select transition from the List, and it contains one action - the Visit Process.

Imagine you want it so that a health worker, when they choose a patient, will see a link to the Visit Process, but, if the patient selected is allergic, the health worker will see something else - perhaps a second Process, let us call it "Allergy Check".

Define for yourself an Allergy Check Process, and
add it to the App as a Component.
Then integrate it into the App Structure by including it into the Main Actions.

Now, we can make the Allergy Check Process only appear as an action to the health worker, if it is known that the patient is allergic.

We can do this by designating True/False fields of an Object (instance) as "switches" (things which turns things on and off).

In the Edit window for the contents of the Main Actions component, click the +Use Switches button.

In the dialogue which appears, you have to select the Type of the Object (instance) you want to use to define the "switches"

Now you can see three new columns, because there are three switches you can define for each Action listed.

Define a switch to determine if the Action should be shown
Define a switch to determine if the Action should be marked (e.g. with a tick)
Define a switch to determine if the Action should be disabled (greyed out and not-clickable)

Now click the Edit icon for Allergy Check.

In the dialogue which appears (as below), you can now select a True/False field from the dropdown against "VISIBLE If.." and make this component (Allergy Check) only appear as a possible Action if the patient selected is allergic (has value true in the field allergic).

Now click the Edit icon for Allergy Check.

In the dialogue which appears (as below), you can now select a True/False field from the dropdown against "VISIBLE If.." and make this component (Allergy Check) only appear as a possible Action if the patient selected is allergic (has value true in the field allergic).

No items found.

App Switches

We have seen how to create and update Object (instances) from within Processes. We have seen how Objects (instances) can be selected from Lists, displayed within Object Views, and passed as input parameters to Processes.

In this tutorial, we will look at some uses we can make of True/False fields of an Object (instance) in configuring the App to adapt its behaviour depending on attributes of the instance.

Let us refer to values of true/false fields as flags.

1. Making List Item display conditional on fields

One thing we can do is use flags in configuring a List Item widget which renders differently if that flags is true or false.

In our example patient object so far, we have defined a small number of fields, including one True/False field called allergic.

Suppose we want to show not only name and date of birth, but also to indicate clearly those patients who are allergic.

We can do this by making an element of the List Item Widget appear for a patient only if the patient is allergic.

Read about how to do this in Conditional List Item Configuration

2. Filtering List with respect to True/False field

A second thing we can do with flags is use them in filtering lists.

Perhaps we don't want a list containing "allergic" and non-allergic patients.

Perhaps instead we want to partition our patients into two lists.

We can do this by defining two patient lists and filtering them appropriately.

Read how to Filter a List by True/False field.

3. Making which actions appear dependent on fields.

A third thing we can do with flags is use them to condition whether certain Actions appear or not.

In our sample App, we have an Actions component.

Currrently, we are using it as the destination of the Select transition from the List, and it contains one action - the Visit Process.

Imagine you want it so that a health worker, when they choose a patient, will see a link to the Visit Process, but, if the patient selected is allergic, the health worker will see something else - perhaps a second Process, let us call it "Allergy Check".

Define for yourself an Allergy Check Process, and
add it to the App as a Component.
Then integrate it into the App Structure by including it into the Main Actions.

Now, we can make the Allergy Check Process only appear as an action to the health worker, if it is known that the patient is allergic.

We can do this by designating True/False fields of an Object (instance) as "switches" (things which turns things on and off).

In the Edit window for the contents of the Main Actions component, click the +Use Switches button.

In the dialogue which appears, you have to select the Type of the Object (instance) you want to use to define the "switches"

Now you can see three new columns, because there are three switches you can define for each Action listed.

Define a switch to determine if the Action should be shown
Define a switch to determine if the Action should be marked (e.g. with a tick)
Define a switch to determine if the Action should be disabled (greyed out and not-clickable)

Now click the Edit icon for Allergy Check.

In the dialogue which appears (as below), you can now select a True/False field from the dropdown against "VISIBLE If.." and make this component (Allergy Check) only appear as a possible Action if the patient selected is allergic (has value true in the field allergic).

Now click the Edit icon for Allergy Check.

In the dialogue which appears (as below), you can now select a True/False field from the dropdown against "VISIBLE If.." and make this component (Allergy Check) only appear as a possible Action if the patient selected is allergic (has value true in the field allergic).

Next Step:
No items found.