display Hyperlink for each record in repeating table - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

display Hyperlink for each record in repeating table

Last post 04-30-2020 07:53 AM by Hilary Stoupa. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 04-29-2019 07:57 AM

    display Hyperlink for each record in repeating table

    Secondary Data Connection: SourceData

    Fields:

    ID

    RecordName

    Added SourceData to view as Repeating table, inserted a column, add a Hyperlink field 'URL'.

    I would like the URL to display dynamically the URL to each of the record in SourceData

    URL default: concat("https://someurl.sharepoint.com/sites/somesite/Lists/SourceData/EditForm.aspx?ID=", xdXDocument:GetDOM("SourceData")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:ID)

    Problem: The d:ID value is static. Every URL on the repeating URL is the same.

    Solution: Please advice!

     

    Thank you!

     

     

  • 04-30-2019 08:14 AM In reply to

    Re: display Hyperlink for each record in repeating table

    Here's what I usually do for this sort of thing. While it is possible to save the form as source files and manually modify the view file to use a formula for a hyperlink, it is easier to just leverage some extra fields in your secondary data connection, if that's an option. Is your secondary data connection to a SharePoint list, by any chance? If it is, include some columns you don't actually need - like Modified and Version. Then you can use these as helper fields - have a rule that sets version to 0, for example, and a rule on version to populate the Modified field with the concat formula to generate a unique link for each URL - then use that in the repeating table. This is sort of messy to explain, so I'm attaching a sample that uses an XML for the secondary data source, just so you can see the technique. Rules are in Form Load and on Version in the secondary data connection - you'll just want to make sure the rules execute after your query. Save the form locally, right click & select Design to open in design mode, then you can preview. Let me know if adding extra fields to the data source to use as helpers is not possible in your case & I'll give you some info on manually modifying the view file.
    Hilary Stoupa

  • 05-01-2019 10:06 AM In reply to

    Re: display Hyperlink for each record in repeating table

    What is that field you have in Link column?

    When I select on it, the Modified field on the Secondary is selected, but itself isn't Modified (data), but instead Item (data). It looks like a calculated field, but how do you turn that into a Hyperlink control?

    Sorry, I just haven't seen such before.

  • 05-01-2019 10:11 AM In reply to

    Re: display Hyperlink for each record in repeating table

    From the Insert tab on the Ribbon, I selected Hyperlink. The formula to set the "Modified" field to the Hyperlink value is on the Version field.... Oh- another thing you could do if this data source is a SharePoint List is add a calculated column to the list itself that has the concatenated value you want to use for your link, then use Insert > Hyperlink and select that field. That would probably be even simpler than using form rules for this.
    Hilary Stoupa

  • 05-01-2019 11:58 AM In reply to

    Re: [answered] display Hyperlink for each record in repeating table

    I attempted the calculated field too, unfortunately ID field isn't one of the selections.

    Anyway, your solution worked. The trick was to created a value change so the rules execute. On data load doesn't always work because the data queries by trigger.

    I used the Version, set to blank then 0. Rules on Version: when not blank... run :)

    Thank you so much!

     

  • 05-01-2019 12:49 PM In reply to

    Re: [answered] display Hyperlink for each record in repeating table

    Wonderful - glad that worked for you!
    Hilary Stoupa

  • 04-29-2020 07:15 AM In reply to

    Re: [answered] display Hyperlink for each record in repeating table

    I have a similar issue. I could go to the document library I want to import from and create a new field and concat the http:// preface to the file name and then add the post-URL syntax, but all of my previous entries will not have this field completed and I would be importing a blank field. I tried adding a rule to my repeating table field to say if "not contains http://" then concatenate the field to add the http:// preface and the post URL syntax - but upon preview, only the original file name displays (whether it is a text field or a hyperlink field). I also tried to update the repeating field xpath by adding the pre-URL syntax and post URL syntax to the xpath file name, but I don't know where my error is: concat("http://worksites.stewartpoint.com/its/infopathwf/_layouts/15/FormServer.aspx?XmlLocation=/its/infopathwf/Agency_Billing/", d:File_x0020_Name, ".xml&ClientInstalled=true&DefaultItemOpen=1&Source=http%3A%2F%2Fworksites%2Estewartpoint%2Ecom%2Fits%2Finfopathwf%2FAgency%5FBilling%2FForms%2FAllItems%2Easpx")

    Filed under:
  • 04-29-2020 08:15 AM In reply to

    Re: [answered] display Hyperlink for each record in repeating table

     I added a field in form/document library I'm importing from that concatenates the URL from this day forward and added it to my data connection. I then tried to add a rule that states if it is blank, concatenate the file name field (also in the data connection) to create the URL - no luck. When I preview, the blank File URL field remains blank.I tried adding a field to the secondary data connection (in my repeating table search form), but it is not allowed.

  • 04-29-2020 08:32 AM In reply to

    Re: [answered] display Hyperlink for each record in repeating table

    Where are these rules running? On a field inside the repeating group? Feel free to send me your form (with some information on where to look for these things) in an email if you'd like and I can take a look.
    Hilary Stoupa

  • 04-30-2020 07:50 AM In reply to

    Re: [answered] display Hyperlink for each record in repeating table

    Hilary, since we did this via e-mail, I adding your comments here for the benefit of others:

    HS: Instead, I’d put a rule on the ID field in the secondary data source, because you are probably not using that list ID for anything. You know it will always be greater than 0, so if you set it to 0, it will change and the rule will fire. Since this data connection is running on load, you could simply add a rule to the FormLoad rules to set the ID in the Agency_Billing data source to 0. Then if the rule to set the URL field is on the ID field, it will fire and the field will be set.

    DAP: Solution worked...you are not only a gentlewoman, but a scholar. Thank you. 



     

  • 04-30-2020 07:53 AM In reply to

    Re: [answered] display Hyperlink for each record in repeating table

    Glad that did the trick for you and thanks for updating the thread!
    Hilary Stoupa

Page 1 of 1 (11 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.