Autopopulate multiple sharepoint list rows in an infopath form. - InfoPath Dev
in

InfoPath Dev

Autopopulate multiple sharepoint list rows in an infopath form.

Last post 11-16-2012 04:53 AM by Kully. 14 replies.
Page 1 of 1 (15 items)
Sort Posts: Previous Next
  • 02-28-2012 03:25 AM

    • beanyjon
    • Not Ranked
      Male
    • Joined on 02-22-2012
    • Coventry, UK
    • Posts 22

    Autopopulate multiple sharepoint list rows in an infopath form.

    Hi all, I am hoping somebody can help me with a dilemma I have viewing SharePoint list items in an InfoPath form.

    I have a SharePoint list with multiple columns, every time a new item is added the user has to choose a main value form a pre define list of choices (a view then groups the items by the field).

    I am happy with users entering data through SharePoint, what I want is for them to open a form, choose from a drop down list of the main field and the form populate with all items connected to that value.

    I have created a new InfoPath form, created a drop down control which links to a data connection to that main field.

    I have then created a single text line control for one of the SharePoint fields, using the Xpath I point it to the SharePoint list data connection > relevant field > filter data > main field is equal to main field in local list.

    This works great for showing only 1 item, how do I show all items? I was thinking of something like a repeating table that auto populates? Please help.

  • 02-29-2012 02:23 AM In reply to

    • beanyjon
    • Not Ranked
      Male
    • Joined on 02-22-2012
    • Coventry, UK
    • Posts 22

    Re: Autopopulate multiple sharepoint list rows in an infopath form.

    Please can somebody help?

    Incase my first post was a bit ambiguous; what i currently have is a sharepoint list with 4 columns:

    "Contract" which is a choice field, "Product" which is a single line text box field, "Date" which is a date field and "Quantity" which is a number field

    the idea is; to add a new item the user will choose the contract and then fill in the rest of the columns details.(all within sharepoint, no infopath yet) Each contract could have 1 item or 100's items.

    I then need a form that has a choice field(Control)  to choose the "contract" and then it populates the rest of the form with the items that use that same "contract", as i said it could populate 1 field or 100's.

    I have tried to acomplish this with repeating tables but to no avail, please help me!!!

  • 02-29-2012 08:02 AM In reply to

    Re: Autopopulate multiple sharepoint list rows in an infopath form.

    What version of ShP / IP are you using? If 2010, you can use InfoPath for the SharePoint List form - and when you base an InfoPath form off a SharePoint list, you have the option of allowing edit of multiple items.

    But, if I understand completely, the real crux of your problem is you want to copy repeating data from a secondary data source into the main data source of an InfoPath form. Unfortunately, that can only be done with code or a code-based add on like qRules. There are no native rules for doing this in InfoPath.

    Hilary Stoupa

  • 02-29-2012 08:11 AM In reply to

    • beanyjon
    • Not Ranked
      Male
    • Joined on 02-22-2012
    • Coventry, UK
    • Posts 22

    Re: Autopopulate multiple sharepoint list rows in an infopath form.

    Thanks for your reply, I am using version 2010 for both.

    Yes i thought you might say that coding is the way to do it.

    i am an amature coder so while i cannot create my own script i can read and modify others.

    I dont suppose you know a place where i could find a sample script to do this or somthing similar i  can then modify?

     Also can you also ellaborate on editing multiple items from a sharepoint modified form? if you mean what i think you do this could come in handy for another project i am working on lol.

  • 02-29-2012 08:20 AM In reply to

    Re: Autopopulate multiple sharepoint list rows in an infopath form.

    Here's a link to customizing a list form: http://msdn.microsoft.com/en-us/library/gg180738.aspx

    Here's a blog post of mine for copying repeating data via code: http://www.infopathdev.com/blogs/hilary/archive/2008/07/04/how-do-i-copy-repeating-data-from-an-external-source-into-my-form.aspx

    I'd really suggest you look into qRules if you want to keep things simple for yourself - here's a link to the product page.

    Hilary Stoupa

  • 02-29-2012 08:25 AM In reply to

    • beanyjon
    • Not Ranked
      Male
    • Joined on 02-22-2012
    • Coventry, UK
    • Posts 22

    Re: Autopopulate multiple sharepoint list rows in an infopath form.

    Thanks allot for the link to your blog, looks like just what im after, will have a play around with that and see how i do.

    qRules does look good but unfortunatly the company i work for do not like to pay for third party products when, as they say "we employ you developers to do that" lol

    Thanks again for your help.  :-)

  • 03-01-2012 04:35 AM In reply to

    • beanyjon
    • Not Ranked
      Male
    • Joined on 02-22-2012
    • Coventry, UK
    • Posts 22

    Re: Autopopulate multiple sharepoint list rows in an infopath form.

    I have tried to follow your blog but i am not having much luck, i think my infopath is defaulting to the wrong programming language, i am using infopath 2010 so the options are quite diffrent to your examples on the blog.

     i have edited your C# code to reflect the control names in my form, but when i paste this into the visual studio application it doesnt see \\ as a comment instead it looks for ' which is VB right?

    Update, managed to change the programming language to C# by clicking the office button then Form Options > Programming > select from a drop down list.

    the code still has errors though so help would be very much appreciated.

    Could i be really cheeky and send you my form? i am starting to loose sleep over this issue :( too much coffee and too little sleep! lol

  • 03-01-2012 06:38 AM In reply to

    • beanyjon
    • Not Ranked
      Male
    • Joined on 02-22-2012
    • Coventry, UK
    • Posts 22

    Re: Autopopulate multiple sharepoint list rows in an infopath form.

    Update, managed to change the programming language to C# by clicking the office button then Form Options > Programming > select from a drop down list.

    the code still has errors though so help would be very much appreciated.

  • 03-01-2012 02:10 PM In reply to

    • beanyjon
    • Not Ranked
      Male
    • Joined on 02-22-2012
    • Coventry, UK
    • Posts 22

    Re: Autopopulate multiple sharepoint list rows in an infopath form.

    Figured this one out on my own again and its dead simple! doesnt need any coding! just some conditional formatting rules.

    first create the data connection to the sharepoint list.
    then from "fields" toolbar, drag the folder below "datafields" into the form as a repeating table. Now if you previewd the form it would now load all of the list items onto the page, so what we need to do is create a control to pic what data we want to display.

    So i create a new data connection to the sharepoint list which has the unique field which the first list looks up from.

    Now create a drop down control and choose from external resource and point to the data connection just created. Choose the ID field for value and the title field for Display name.

     Now click on the repeating table and choose manage rules > add a new rule > choose condition, use the field in that list which holds the same values as the field chosen in the second data connection, select "is not equal to" then choose the drop down control created earlier. under rule type choose formatting then check the "Hide this control" box.

     Thats it! very simple!! ...well when you know.

  • 03-01-2012 02:17 PM In reply to

    Re: Autopopulate multiple sharepoint list rows in an infopath form.

    Oh, I see, you just needed the data to display as read only in your form! That's a whole different thing, as you figured out - great job!

    Hilary Stoupa

  • 03-02-2012 04:40 PM In reply to

    Re: Autopopulate multiple sharepoint list rows in an infopath form.

    I am in the exact same situation. I dragged my data field from my Sharepoint library onto the infopath form using a secondary data connection. The infopath form works correctly as far as getting the data from my Sharepoint library. The issue that I am having is that some items in the Sharepoint library do not have every column filled with data. When I go to preview the form, the form is filled with the data along with a lot of blank repeating sections. I tried applying conditional formatting both to the repeating section and the text box inside the repeating section. The conditional formatting checked to see if the secondary data connection the repeating section/text boxes were bound to were blank and if so it would hide the control, but this did not solve the problem. I was wondering if there was a way to eliminate/hide these blank sections within the form. Or if there is a better way to get the information from a Sharepoint library merged together filtered by drop down lists selected by the user, please let me know. And yes I know Sharepoint has built in functionality for merging, but it is not feasible for my situation since I will be merging 50+ items at a time and clicking the merge check box for each item would take too much time. Thanks for the help.
  • 03-02-2012 04:50 PM In reply to

    Re: Autopopulate multiple sharepoint list rows in an infopath form.

    So - is it that your conditional formatting is failing / incorrect? Can you maybe attach a screenshot displaying what you are talking about?

    If your conditional formatting is working correctly, is it possible your repeating section is inside a table cell where the row height is not set to Auto? And that is what is causing your blank space?

    Hilary Stoupa

  • 03-05-2012 08:52 PM In reply to

    Re: Autopopulate multiple sharepoint list rows in an infopath form.

    Yes the conditional formatting is not working to remove the blank items. I have several repeating sections that each copy the data directly from a column in a sharepoint library. Each is a text box within a repeating section that is bound to my sharepoint library. The problem is that not all of the items in the library have data in all the columns. So when I preview the form (I'll call it my merging form), the user has the ability to "filter" the data coming into those repeating sections by who the file was created by and the date. This is where I currently use rules to properly "filter" the data, and this part works correctly. So to make my issue more clear, here is an example: a new file is added to the sharepoint library for each person every week. The sharepoint library has a two columns: "Regulatory" and "Operational" that are populated when a separate form is submitted to the library. So I use my merging form to get all the files from an employee for 2011. This returns 52 text boxes for each of the two sharepoint columns (Regulatory and Operational). This is where the issue comes. Not all of these 104 text boxes (52 for each column) have text, since the sharepoint library that these are bound to do not have text. I want to not show the blank boxes so the form is more readable. If someone knows a way to do this or if someone has a different method to "merge" a large number of sharepoint library items, I would appreciate it.
  • 03-06-2012 02:26 PM In reply to

    Re: Autopopulate multiple sharepoint list rows in an infopath form.

    I see - so the issue is going to partly be too many columns in some instances - and IP doesn't let us conditionally format columns (and you wouldn't want to entirely hide them, since you may or may not have data in the field).

    I guess you could always use a single table row with all your fields, and conditionally format each field to hide when blank. That sounds like a lot of effort, and you wouldn't be able to have any kind of column header since you wouldn't know what info would be in any given column.

    Hilary Stoupa

  • 11-16-2012 04:53 AM In reply to

    • Kully
    • Not Ranked
      Female
    • Joined on 11-16-2012
    • Posts 24

    Re: Autopopulate multiple sharepoint list rows in an infopath form.

    Hi,

    I am having the same issue as beanyjon mentioned earlier.

    I have a dropdown list which is pulling a list from SharePoint 2010, i then have a button which once clicked I would like the information from the sharepoint list (all columns) to be populated in a table a below. The reason for this is I am creating a form which will allow users to select an item from a drop down list and then add it to a table below, which will contain the product name, item code and allow them to enter the quantity.

     I followed the steps mentioned by beanyjon and it seems to work once and then when another item is selected, this does not add another row to the table below and also the options in the drop down list all change to the same i.e I have 5 options of the same item listed within the dropdown list.

    Can you please assist with this issue.

    Thank you

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