Follow Us:
As part of an auction site I was working on for a client, one part of the solution was to use an InfoPath form for users to submit their bids. In another post I might detail all of the solution but in this post I want to focus on how to get the dynamic images from a SharePoint Picture library. These were the basic requirements for the form:
For this post you will need the following components:
As I mentioned above for our solution, we need a SharePoint site and two libraries; one for the images and one for the InfoPath form. Since nothing is custom I won’t give you the step by step for creating a basic site. Here is the rundown for the libraries:
What makes this all possible is using an XML data connection. Normally it would be easy to wire the dropdown to a SharePoint list data connection and you could choose your column via the data connection. To show the picture on the form, we need the picture URL. This would be easy if we could load the Name column from the data connection, but we can’t! What we can do is an XML data connection instead, and we can get to any column we need from the view.
Let’s check our progress. Upload a few pictures to the library, give them a title and description, and make at least one is set to not be available. Preview the form, and choose an item. The description and image should magically appear:
Pat yourself on the back, great job! Now you just need to finish the form as you please, then add a button for submit to the form library we completed. During publish just choose to update an existing form library we created. Also check that what shows in the dropdown is filtered, you should not see all items.
This works with web applications that use Classic authentication. If you’re using Claims, by default this won’t work and you will get an error “"XML data that is required for this form to function correctly cannot be found”. There are some workarounds using BCS and Secure Store but I can’t speak if they work or not. So just be aware.
For more information about C5 Insight or this blog, please Contact Us.
Hi Doug, Iam using Claims Authentication in my web Applications and im getting this error "XML data that is required for this form to function correctly cannot be found" as you mentioned in the "One Note of Caution". can u help me to get rid out of these problem? thanks Arthanari
Doug, I was reviewing the steps and I see that in step 3iii you mention a field called Name which was not previously mentioned. What field is that referring to?
Sarap, The Name field is the default system field that is on every document library by default. It represents the filename of the file (like image.jpg). Doug
Thanks so much for this walk through, it has helped me greatly. However I am trying to perform this in a repeating table, however when i select the item in the next row both pictures change to match this selection. Is this something that I need to change in the rule?
SPUser, Are you using a picture library or a custom library with a hyperlink field? It sounds like a hyperlink column that is using the link and not a picture. Or, you could potentially not be getting the proper URL in the Image field on the form. Is it clickable on the form? Doug
When you provided the link in step 6, and you say "your site URL" in orange, are you referring to the form library, the image library, or the data connection?
Hi Sarahp, I am referring to the path of the site collection and subsite URL that contains the list that has the image library.
Chrisatlake, From your description, does your path have /XML on the front of it? Are you able to see the XML page in step 6.iii? Did you make sure it is loading the data source when is form is opened? Doug
Doug, Yes, I can see the XML in step 6 and it is loading the data source when the form is opened. I can drill down to the source as shown in step 7 but when I choose rs:data/z:row and click OK, that is when I get the error. - - - - - - - - - - - - -
Hey Doug - thanks for this very informative walk-through for an auction site. I am having some difficulty in that my pictures are not appearing. The jpg symbol is there, however it is white with a red x. Any ideas? Many thanks.
Alex, the problem is either in the data connection, or where you are setting the field value with the concat formula which is where you're dynamically building the URL to the image. I assume your web application is not claims based? Are you getting the name and description, just not the image? Or are you not getting any values? if you're just not getting the image but are getting the Name, its in your set field value action. If you're not getting anything, check your data connection. I would suggest writing that field as a text URL and put it on the form so you can see the URL you are getting, and make sure it is a valid URL to your images.
Hi Doug, Is it possible to show the image in the display form as a thumbnail? It now displays as a link. Please let me know. Thanks again for the wonderful solution. Sp User.
TZichterman, My client who I did this for did not want to store any history of bids; the form only submitted to an email who monitored the process. Obviously for most auction style scenarios, you would want to retain that. I would think of 2 lists, one for the product and one for Bids, with a lookup to the product. You would have the InfoPath form submit to create a bid on the InfoPath form. For SharePoint 2013, we did another version where it was purely with an aspx page and javascript that had a live timer countdown, tracked the highest bid, etc. That was much more robust, though required code vs. InfoPath. Doug
Thanks again Doug! Very informative. Agree that a code solution would be better, just not a developer personally.
Doug, At step 7, when I choose the Path rs:data/z:row, I am prompted with "You must select a repeating group or field", although my fields appear to be the same. Any ideas? It looks exactly what I'm looking for though and would really like to get it working. Thanks.
Doug - thanks for the overview. I am in the process of putting together a similar auction site using Infopath and Sharepoint 2013. Interested in how you organized your fields for the bidding process. Especially allowing for quick refreshes to update the current bid amount. Thanks, Tom
The complementary paper includes over 12 years of research, recent survey results, and CRM turnaround success stories.
Request Download
This 60-second assessment is designed to evaluate your organization's collaboration readiness.
Learn how you rank compared to organizations typically in years 1 to 5 of implementation - and which areas to focus on to improve.
This is a sandbox solution which can be activated per site collection to allow you to easily collect feedback from users into a custom Feedback list.
Whether you are upgrading to SharePoint Online, 2010, 2013 or the latest 2016, this checklist contains everything you need to know for a successful transition.