Hide/Show form section depending on the logged in user group

Is it possible to use Javascript on a custom DHIS2 form to show/hide a section of the form depending on whether a user belongs to a given group or even role?

Hi @salad_guyo1,

Welcome to the community!:tada:

It might be possible with the use of API but the code could get complicated and might make it difficult to generate the PDF reports; however, this option is a feature that you will be able to find out of the box in Tracker configuration so you might want to consider using it instead.

Maybe if you share the use case for hiding dataset sections based on user group it will help with finding out what options you might have. There might be other implementation methods and best practices for certain scenarios.

Thank you!

1 Like