Embedding a clickable URL into a capture program

Good day,

As the title suggests, I want to embed a clickable URL into a program stage so that users of the Capture app can access an external resource. Adding an URL to the program’s section description makes the URL visible but not clickable.

Any suggestions would be welcome.

Thanks!

Hi @ACoetzer1988 !

In DHIS2 2.43, a Program Stage can use a Custom data-entry form.

The form editor has a Source mode where you can enter HTML directly.

How to configure it

  1. Go to Maintenance → Programs
  2. Open your program and select the relevant Program Stage
  3. Under Data entry form, choose Custom
  4. Open the form’s Source view.
  5. Add your HTML <a> element with the external URL.
  6. Save the form and then save the Program
  7. Open the program in Capture and test the stage.

The important distinction is:

  • Section description: URL is displayed as text → not reliably clickable
  • Custom data-entry form → Source: HTML can be entered → you can create an actual clickable <a> link

I’m sure you can do it :clap:

Hi @HanyAly

Thanks for the advice. I tried it now and the solutions works well on the web platform, but not on the capture app. From my understanding, custom forms do not render on the capture app.

On the web platform, the custom form displays as a clickable link, but on the capture app it reverts to a different page layout where the clickable link does not even appear.

Am I missing something or is there an alternative approach I can try?

Hi @ACoetzer1988

If you tell me what the external resource is for (e.g. PDF guideline, website, video, Google Form, DHIS2 dashboard, another app/web application),

I can suggest the most practical Capture-compatible workaround for DHIS2 2.43, including whether a data element, program rule, tracker note, or another metadata mechanism can make it genuinely clickable.

I’m sure you can do it :clap:

Hi @HanyAly

The link is to a google form.

We are on V2.42.2 in case that makes a difference.

Thanks in advance.

Hi @ACoetzer1988

So you could try this:-

1.Create a data element, e.g. Google Form – Patient Feedback.
2.Set its Value type to URL.
3.Put that data element in a section of your Program Stage.
4.Give it a user-friendly Form name, such as:

Open the patient feedback form
5.Enter the Google Form URL as the value.
6.Sync the Capture app and test it.

I’m sure you can do it :clap:

Thanks @HanyAly

That does not quite solve the problem as the user would have to have the URL copied to enter it into the field. If the user already has the link, they could just open it directly from outside the Capture app.

It looks like the link will have to be saved outside the app and accessed from there as having it clickable via the app does not seem possible.

Hi @ACoetzer1988

I’d consider one of these workarounds:

  • QR code displayed/printed alongside the form, which users scan with the phone

  • home-screen shortcut would probably give users the smoothest experience

  • A URL data element displayed so users can copy/open it manually

  • Put the Google Form link in the program/stage documentation or another accessible resource outside the data-entry form

I’m sure you can do it :clap:

@ACoetzer1988 - when you are talking about the Capture app, you mean the Android Capture app, not the Web Capture app? Just to doublecheck.

Hi @Karoline

I am sorry for the confusion. Yes, I am referring to the android based app (DHIS2 Capture).

My sincere apologies, I realised now how confusing my responses must have been up to now. :slightly_smiling_face:

Hi @HanyAly

Thanks for all the advice. I managed to find a solution that works in the android app.

I created a data element (URL value type) and set up a program rule action to assign a value of static text (the URL). Because the data element is set to URL type, it has an icon on the side of the DE that can be clicked to open to the URL.