If somebody like the post and its helpful in your work then, add comments.

Tuesday, January 6, 2009

Programmatically set url to hyperlink field in InfoPath

We do not access the Hyperlink in code. If you want to set that hyperlink value in code then in design mode you to follow these steps,
  1. Right click on Hyperlink to get Edit Hyperlink window
  2. Select ‘Data source' option in ‘Link to'.
  3. Click on icon to select which field data you want to bind it.
  4. Click on OK button.
    In your code you have to set step3 field data as what link you want to show in hyperlink.


  1. Hi, I appreciate the steps that you have given and tried them as well. However, it does not seem to be working for me.

  2. Hi Anand,
    Can you tell me what are the exact steps you have followed

  3. Hi,
    I have the following scenario:
    1. I have a WF using Infopath task forms.
    2. I have a form, which has a hyperlink field.
    3. In the workflow, I store a set of documents in a doc lib.
    4. The hyperlink field on a form, needs to be programmatically get updated to link to these documents in the doc lib. So, when I set this value using the task properties extended properties hash-table, the hyperlinks do not seem to work. They always point to http://:/_layouts, which, I believe, is the default url when you drop a hyperlink field onto an infopath form.

    5. As you said, I am updating the Data field on the infopath form from within my workflow.

    Could you please guide me resolve this issue.

    Thanks & Regards,

  4. I am new to sharepoint and infopath form.Is it possible to add static values or read only field to infopath form.Also this static field or read only field data or value fetching from another sharepoint list.

  5. Hi,
    Yes you can add textbox on the InfoPath form and make it read only by going on textbox property->Display ->Check read only.

    Second option is also possible, make a data connection from 2nd list and drag that field on the form and repeat the above steps to make read only. If you don't want to display that read only boxes then hide them in the form.

  6. • Nice and good article. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time. Please keep updating. Power Bi Online COURSE