Drop Down List - Looking up data on Sharepoint list - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Drop Down List - Looking up data on Sharepoint list

Last post 02-18-2009 05:28 AM by Svetoslav. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 10-24-2007 01:03 AM

    Drop Down List - Looking up data on Sharepoint list

    Dear All,

    I have recently been asked to assist a colleague on implementing some InfoPath forms, that use Sharepoint lists as there source of data.

    The form I am implementing, is to list software required to be installed on PCs. We have a list on a sharepoint site, where these are stored, for example:

    Item                                Cost            Ongoing Costs

    Paint shop pro                 £65              £32

    Ms Project                      £95              £70

    Adobe Acrobat                £32              £22

    I have a repeating table, which contains a combo box, bound to this table to retrieve the "Item" field. On each row is also two text boxes I am using for debugging purpose.

    The combo box works fine, lists the "Item"s, and allows multiple "item"s to be selected, by adding new rows to the repeating table.

    I am using (whether it be right, or wrong, I don't know - please advise!) a rule attached to the combo box to look up the price of that item, and I am using my two text boxes to debug these prices. The rule I am using is:

    Set a fields' value: txtTempSWCost = @Cost[@Item = Software_Name]

    Where @Item is the "Item" field in the sharepoint list, @Cost is the "Cost" field in the sharepoint list and Software_Name is the name of the combo box that I am selecting.

    The problem I have, is that if I select "Paint Shop Pro" first, it returns the correct value of £65, but if I add a new row to the table, and choose, say "MS Project", that too comes back as £65. The really confusing part is that if I select as my first row "Adobe Acrobat", then any subsequent rows work fine - it is almost as if that the first row returns back all the data from the list UP TO the value selected, so if I choose "Paint Shop Pro", I only get that row from the list, but if I choose "Adobe Acrobat" I get returned all the rows.

    The XPath for this, if it helps is:

    xdXDocument:GetDOM("Price Software")/dfs:myFields/dfs:dataFields/dfs:Price_Software/@Cost[../@Item = xdXDocument:get-DOM()/my:myFields/my:SR_new_hardware/my:group68/my:group69/my:Software_Name]

    I have read that the XPath method current() can be used to return the current item, I have tried it everywhere after the ../@item = part, and I get formula errors everytime!

    I hope this makes sense, and someone can help, or advise an alternative way of looking up data from a sharepoint list for each drop down lit in a repeating table.

    Thanks in advance,

    James.

     PS: I am using Infopath 2003.

  • 10-24-2007 01:52 AM In reply to

    Re: Drop Down List - Looking up data on Sharepoint list

    Hi Everyone,

     Looks like the following works:

    xdXDocument:GetDOM("Price Software")/dfs:myFields/dfs:dataFields/dfs:Price_Software/@Cost[../@Item = current()/../my:Software_Name]

    James.

  • 02-18-2009 12:36 AM In reply to

    Re: Drop Down List - Looking up data on Sharepoint list

    Hello James,

    I am experiencing the same problem, when using a repeating table with a SharePoint list. I tried your solution with using current() at the place in the XPath you have shown, it shows me error. My whole work is based on this concept and I have to overcome this problem. If anyone can help me, I will be very grateful.

    Thank you in advance

    Svetoslav

  • 02-18-2009 12:41 AM In reply to

    Re: Drop Down List - Looking up data on Sharepoint list 19.02.2009

    Hello James,

    I have the same problem when retrieving a data from a sharepoint list, using a dropdown in a repeating table. My observation led to the conclusion that it is not only for the 1st item of the list, but for a specific items... since my list is bigger. I followed your solution approach and I find it suitable, but I cannot input the "current()" on the shown place-it shows error. Can anyone help?

     

    Svetoslav

  • 02-18-2009 05:28 AM In reply to

    Re: Drop Down List - Looking up data on Sharepoint list

    Hello,

    i found a solution for the problem, againa using "current()" but instead of placing it infront of the XPath, I simply replaced the XPath with the "current". It works just fine!

    Svetoslav

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