How to assign forms to certain health workers?

I have created a XLSform and compiled to cht code after that how can we provide access to the certain cht health workers.

Hi @sagar.tukilogic

You can use the context’s expression property from the properties JSON file that is uploaded with the form. Please look at this link for more information. Also you can refer to this example, where any user with role chw or chw_supervisor can fill out the “Replace User” form.

    "icon": "icon-death-general",
    "title": "Replace User",
    "context": {
        "person": true,
        "place": false,
        "expression": "user._id === contact._id && ['chw', 'chw_supervisor'].includes(user.role) && (!contact.user_for_contact || !contact.user_for_contact.replace)"