Showing instructions in mobile app tracker,

Dear community,
do we have an option of displaying instruction to the user on how data has to be entered on a specific data element or section in mobile app? I mean the way of displaying static text which are not warnings or errors, I mean if I want to instruct next steps to a user according to the answer given
@Gassim @jaime.bosque would you kindly assist?

Thanks

Pachat

2 Likes

Dear @Pacifique_Hategekima,

Thank you for the question and the tag! As you can see the docs does mention the action “Display Text” which is a different option than ‘showing warnings or errors’; however, this action needs to be configured properly to display the text. An essential point is if you want the text to be displayed in the form then make sure the " “Trigger rule only for program stage”" is selected (and variable needs to be from current stage) whereas not selecting it will make the text appear in the indicators tab and NOT in the form.

It might be a bit more helpful if you add description to your program and the variable you’ll be using as you can see the columns below describe different situations (all for the same action).

Action Description of action Program with registration Program without registration Notes on implementation
Display Text (Tracker Programs) Used to display information that is not an error or a warning, for example feedback. 1. Program rule configured as “Trigger rule only for program stage”. Text will be displayed ONLY in the form as the last element of the last section. Text will be displayed as the messages in the indicators tab. → If the program rule uses any variable type which is not from the current stage, the rule will not be able to evaluate and the message will not be shown.2. Program rule NOT configured as “Trigger rule only for program stage”. Text will be displayed ONLY in the indicators tab and NOT in the form.→ If the program rule uses any variable of type Current event, the rule will not be able to evaluate and the message will not be shown.

Action Description of Action Data Element from the Newest Event in the Current Program (with registration) Data Element from the Newest Event in the Current Program (without registration) Data Element from Previous Event (with registration) Data Element from Previous Event (without registration) Data Element from the Newest Event for a Program Stage (with registration) Tracked Entity Atribute (with registration) Notes on implementation
Display Text (Tracker Programs) Used to display information that is not an error or a warning, for example feedback. 1. Program rule configured as “Trigger rule only for program stage”. Text will be displayed ONLY in the form as the last element of the last section. Text will be displayed as the messages in the indicators tab. → If the program rule uses any variable type which is not from the current stage, the rule will not be able to evaluate and the message will not be shown.2. Program rule NOT configured as “Trigger rule only for program stage”. Text will be displayed ONLY in the indicators tab and NOT in the form.→ If the program rule uses any variable of type Current event, the rule will not be able to evaluate and the message will not be shown.

For docs section, see: Program rule Actions supported

1 Like

This is more useful especially on web app where widgets are on the same dashboard as data entry area, however on mobile app, seems not useful as instructions, because to see them you need to open dashboard tab, it would be useful only if it is information but not if it is instruction(instructions need to be immediately seen when they are triggered), any suggestion on how I can handle this? I was thinking on creating another data elements and name it instructions of long text value and assign it default value in that text area, but the problem is, do we have the option of setting default value in text area field?

Thanks for quick response
Pachat

1 Like

That’s a good question! I think this excerpt from the docs might help:

(Optional) In the Field mask field, you may type a template that’s used to provide hints for correct formatting of the data element.

NOTE

So far this is only implemented in the DHIS2 Android Capture app; not in the Capture and Tracker Capture web apps.
The following are special characters that can be used in the mask. The special characters match exactly one character of the given type.

Character Match
\d digit
\x lower case letter
\X capital letter
\w any alphanumeric character

For example, the pattern can be used to show hyphens as needed in the input field of the data element. E.g "\d\d\d-\d\d\d-\d\d\d, would show a hyphen for every third digit.

1 Like

Hi @Pacifique_Hategekima

If I understand right you want to have a long text somewhere in your form with instructions for users on how to fill specific fields.

In my opinion having a long text value at the begining for the whole form might not be ideal as it probably should be per DE. If that’s what you would want maybe the following ideas could help:

  1. Create a PR that display a warning message under each DE with information and the warning is displayed as long as the DE is empty. Like this the message disappears as soon as the user types but when they delete the message they could see the instructions.
  2. Probably you should be using the (i) icon next to the DataElements and which purpose is basically that, providing information to the users about the DE. Look at this example:

In the future the second option will probably include html tags so rich text should be supported (you could follow this ticket: [ANDROAPP-3635] - Jira

2 Likes

Nice @jaime.bosque, thanks!