Developing forms with dynamic fields in DHIS2

Developed good features applications in DHIS2 by customizing Tracker Capture app, now we need to develop or use DHIS2 app with dynamic form features where (1) The numbers of fields are dynamic (can be increase on clicking ‘+’ button and removed on clicking ‘-’ button) (2) Data in next form or stage can be filled on the basis of first form or stage. Is it possible in DHIS2 ? If yes then how ?

Hey there @Mohsin_Ansari

  1. How is your underlying model for this? Would the user be able to add as many number fields as they want? I assume that this part would require some development.
  2. This can potentially already be done with program rules if your app or fork are running the rules engine. Make a program rule variable with the “Data element from previous event” type, and then assign this value to the current event with a Assign program rule action.

Best regards
Markus

1 Like

Hi Markus,
We have already developed a java application with above functionalities as shown in the screenshot, now we want to develop DHIS2 app.

  1. Number of data elements are not constant they vary as per user choice.
  2. I think program variables and program rules can not be used as data elements vary.

Hi Markus,
You need more elaboration ?

Hi @Mohsin_Ansari !
Could you add to my understanding how the data is modeled based on the screenshot above? What is a data element, how much is stored in one event? We see two lines above, are these two events, or somehow stored in one?

Markus

1 Like

Screenshot above is not a DHIS2 web app but custom java application developed by our team which currently we are using. We have MySQL database for storing the data of these forms.