Automatically fill fields

Hi all,

I have a repeatable stage with Yes Only data elements.

I would like to know if it is possible to create a program rule to autofill Yes Only data element based on the same selected value in the previous stage. If A - Tem Tip – tap and A - Tem aterro Sanitário are, for example, selected the first time, I would like to have them auto filled/selected by default the second time I enter data for the repeatable stage.

Gratefully

Yes, this is possible by using Program Rules Variables and using the "… from previous event"

You should create that program rule variable and then create a program rule that uses that value to populate the field.

Hi @jaime.bosque,

Should I create a program rule variable and a program rule for each Yes Only data element? What would be the steps to achieve my aim?

Thanks

Yes, indeed . You would need to create one Program Rule Variable per variable to be able to carry it over. And then create the same amount of Program Rules where this PRV is evaluated and the fill performed.

Hi @jaime.bosque,

I have created two program variables and two program rules as a test, but the program rules seem not to be working. Below is one example of both prv and program rule




Selected DEs in the previous stage appear disabled but not checked in the next stage, which means the PR might not be well built.

Thanks again.

Dear @hernandezmachava
Your action should assign the A - Tem Tip - tap a Yes
Regards

Hi @prosper,

I have assigned Yes to A - Tem Tip - Tap, but the PR is still not working.

Thanks

Hey @hernandezmachava

I have created an example program for you in the 2.34 play https://play.dhis2.org/2.34.4 program is called Carry PRV and you can access with the user tracker password District1#

image

Note that this will only be available today before the server is reset so I am adding the JSON that you could import in that server whenever you need. As I cannot upload .zip files please remove the .pdf extension carry_prv_android_web.zip.pdf (3.1 KB)

This should work both in web an Android

Hi @jaime.bosque,

Following your example program, I was able to get the PRs working.

Thanks

1 Like