How to populate the hyperlink controls in a repeating section from a data connection

Hi 

I have a repeating section and within the section, I have a hyperlink control. I would like to populate the hyperlink controls from a data connection, which will generate a list of hyperlink. How can this be done within the Infopath form?

Thanks in advance. Your help would be greatly appreciated.

September 10th, 2015 12:46pm

Add a calculated value to your repeating section. In that calculated value you will 'build' your xpath query. This will be a concatenation of the static component of the url ie. 'http://site/list/form.aspx?UID=' and then some local value. IF you were to do the logical thing and just pick the field from the prompt it'll just show you the same value on all items.

Instead you have to cheat, in the formula section you should tick the box that says 'show xpath', then replace the long section for the local field with something like 'current()/d:Title' which will get the current item's title value.

That will then display your link location and you can copy the xPath that it uses into a link's data field so that the link automatically gets the right path.

This shouldn't work in browser forms according to some documentation however it does in practice. There's probably a couple of blogs that describe this better than I have done but it's possible to do


Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 4:35am

Hi,

According to your description, you want to populate the hyperlink controls from a data connection, which will generate a list of hyperlink.

I assume that the data source is receiving data from SharePoint list which contains a hyperlink filed named hyperlink.

You can set rules on the hyperlink controls in InfoPath form:

Then it will looks like the following:

Hope that helps and feel free to reply back.

Best Regards

Lisa Chen

September 11th, 2015 5:48am

Add a calculated value to your repeating section. In that calculated value you will 'build' your xpath query. This will be a concatenation of the static component of the url ie. 'http://site/list/form.aspx?UID=' and then some local value. IF you were to do the logical thing and just pick the field from the prompt it'll just show you the same value on all items.

Instead you have to cheat, in the formula section you should tick the box that says 'show xpath', then replace the long section for the local field with something like 'current()/d:Title' which will get the current item's title value.

That will then display your link location and you can copy the xPath that it uses into a link's data field so that the link automatically gets the right path.

This shouldn't work in browser forms according to some documentation however it does in practice. There's probably a couple of blogs that describe this better than I have done but it's possible to do


Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 8:34am

Thanks Lisa. 

Actually the data source is not from a SP List, it is just a simple list of string.

e.g.

www.google.com

www.microsoft.com

...

How can that be done? Thanks in advance

September 11th, 2015 9:00am

Thanks Lisa. 

Actually the data source is not from a SP List, it is just a simple list of string.

e.g.

www.google.com

www.microsoft.com

...

If it is easier, I can add another ID column, so that each link above will have an associate ID

How can that be done? Thanks in advance


  • Edited by wkpli Saturday, September 12, 2015 12:09 PM
Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 12:58pm

Hi wkpli,

Yes, you just need to add another ID column, so that each link above will have an unique ID in ascending order.

By comparing the id with the count of the hyperlink controls to generate a list of hyperlinks.

How do you create the data connection? Please offer it step by step, it would be better to offer a screenshot.

Best Regards,

Lisa Chen

September 15th, 2015 1:57am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics