Hide New reports tab on Reports section

Is there a way to hide New Report button on Reports tab on CHT?

All of our forms/reports are contact specific and reports are submitted from Contacts tab. This new report on reports tab is creating confusion amont our CHT users and has not been useful. How can we disable or hide this?

In the reference page on CHT docs for the app forms, under the Properties section, the description for the property context.expression says:

By default, forms are not shown on the reports tab, use "expression": "!contact" to show the form on the Reports tab since there is no contact for this scenario.

However, the forms still show up by default on the reports tab. To hide them, I use:

"expression": "!!contact"

If there are no visible forms, the button New Report will also disappear.

I have raised a documentation issue to correct the docs.

1 Like

To hide them, I use: “expression”: “!!contact”

Hi @binod , We also have other expressions like for which type of contacts the form is displayed and we control that in expression. Is it posisble currently to have that condition as well as not show new report on reports tab?

Yes, we can add other conditions too. However, since most of the conditions are based on the contact, these conditions are usually enough to hide the form in the reports tab. For example, if we want to limit this form to only female, we can have this in the form context:

"expression" : "contact.gender == 'female'" 

Now, this form will not show up in the reports tab because there will be no contact.