Hello All,
I am almost done my project (thank god and of course some of you). The last thing I need to be able to do is read a image link from our sharepoint site and have it display in the form. Unfortunatly this picture has to be dynamic, allow me to elaborate:
On the sharepoint site is a list that houses the following columns (Component, Version, and Image_Link). The Component performs a lookup on my components list, version is free form and Image_Link is a link that points to a picture on the web (within our sharepoint site in this case).
Inside of InfoPath I have setup a data connection called 'Component Images'. This data conenction links to the list above. I have also placed a picture control onto the form and assigned it the 'Link to' value. Inside the XPath of the picture control (named Image) is the following:
xdXDocument:GetDOM("Component Images")/dfs:myFields/dfs:dataFields/dfs:Component_Images[@Version = "2.00" and @Component = "Building Select"]/@Image_Link.
As you can see I have hardcoded the @Version and @Component values which works fine (it is displaying the picture for the 'Building Select' component of version '2.00'). The problem here is I want this to be dynamic. "2.00" should be the name of my version control (my:version) and "Building Select" should be the name of my component control (my:comp_name).
I have tried the following and several variations, but I cannot figure out what I am doing wrong:
xdXDocument:GetDOM("Component Images")/dfs:myFields/dfs:dataFields/dfs:Component_Images[@Version = //my:version and @Component = //my:comp_name]/@Image_Link.
xdXDocument:GetDOM("Component Images")/dfs:myFields/dfs:dataFields/dfs:Component_Images[@Version = my:version and @Component = my:comp_name]/@Image_Link.
Any help would be greatly appreciated,
Thanks,
Ryan