Combination XPath for an image source - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Combination XPath for an image source

Last post 06-01-2017 08:06 AM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-30-2017 03:27 PM

    • kee81
    • Not Ranked
    • Joined on 10-25-2016
    • Posts 9

    Combination XPath for an image source

    Hey all, I've got a form where a user can select an image from a file picker, and just the file name+extension is saved in the database. The filepath to the image folder is stored in a separate table, a table which only ever has 1 record, which is queried for via a secondary data source. Is it possible to have a picture control on the InfoPath form that concatenates the image path + file name/extension? That way the user can actually see the image on the form. You can kind of see my structure below. @picture is the filename+extention of the current record on the main data source. The XPath path is the secondary data source. What I've been trying is something like this: /dfs:myFields/dfs:dataFields/d:settings/@image_directory + @picture /dfs:myFields/dfs:dataFields/d:settings/@image_directory[0] + @picture /dfs:myFields/dfs:dataFields/d:settings/@image_directory[1] + @picture /dfs:myFields/dfs:dataFields/d:settings[0]/@image_directory + @picture ... etc. Been trying those variations and can't seem to get it to work. I know the data source is successfully querying the image path. Not even sure if it's possible to do it that way. Would be nice in case we decide to move the files later. Cheers, Rich
  • 06-01-2017 08:06 AM In reply to

    Re: Combination XPath for an image source

    So - I think that yes, you could do this. You'll need to use a concat formula - concat(fieldwithURL, "/", fieldwithpicturevalue) for example, and use that for the default value of a field that is bound to a linked pic. Simple sample attached. Save the file locally, right click, select design & preview. You'll see in my sample the equivalent to your @picture includes a bit more of the path, that's just because I was looking for publically available images with similar URLs to kind of mock up the concept. :)

    Hilary Stoupa

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