Auto fill of fields

I am working on a certain project, i have number of data elements, so among the data elements, some data depends on some fileds to get value, for example data element B - data element C = data element D, so how to automate this, in a way that when user is feeling the form, the moment he set field B and field C then field D should be automatically field, how can i do this…

Hi @Mofo

If you are using Tracker then you can use Program Indicators and if you are using Datasets then you can use indicators. In both cases, the result of the calculation will only appear after analytics tables export is processed (Data Administration app).

However, if you want the result to instantly appear then in Tracker you can create a program rule instead, and in aggregate (datasets) you can create a custom form and use JavaScript in the HTML code of the form.

I hope this helps. Please refer to the documentation and other related CoP posts for step by step instructions or more info.

Thank you, but then my data elements is aggregate and in datasets, and again my skill set if minimal so i was looking for a way to implement without using script, is there anyway to work around this so i achieve this ?

Hi @Mofo

I understand your concern there’s also a challenge when using custom JavaScript i the form because it might not work when generating reports and probably won’t function in the Android form.

Could you share more about the use case and maybe why the automation is important?

I would like to add that program rules in tracker don’t require scripting and will probably solve the issue if it’s possible for you to use Tracker for the use case.


The need for auto fill is so important since my datasets section will contain a very long list of data fields, adn many fields depends on other calculations of two or fields to be filled, so to avoid giving user tiresome job of filling every field, the auto fill could help when user has filled fields which are needed to perform the calculations, hope you get me there.

Would it still be possible to use tracker instead of aggregate datasets?

If tracker will be able to work as aggregate then its okay, i hope you understand my case, the data is aggregate but if using tracker won’t change things much, then i can use it, just tell me if it can work properly.

Tracker can be aggregated; however, there’s a lot of configuration and design that needs to be done to get the proper analytics.

Please have a look at the Tracker Configuration academy (2022) for a better idea:

Thank you, i hope this will help, if it won’t then i’ll come again.

1 Like

@Mofo, it can be achieved easily by program rules.
Create PR, condition : (d2:hasValue(‘A’) && #{A} == 'some_value") , action ASSIGN value to DE/TEA = new-value.

1 Like