Calculate Totals From Sharepoint List Repeating Table & Multiple-Selection List Box - InfoPath Dev
in

InfoPath Dev

Calculate Totals From Sharepoint List Repeating Table & Multiple-Selection List Box

Last post 05-04-2017 09:22 AM by Hilary Stoupa. 16 replies.
Page 1 of 2 (17 items) 1 2 Next >
Sort Posts: Previous Next
  • 04-28-2017 09:04 AM

    Calculate Totals From Sharepoint List Repeating Table & Multiple-Selection List Box

    Hello, I've been thrown into the fire with very little experience in InfoPath. I want to display the total cost from a user's multiple-selection list box selections. Google let me to this post http://www.infopathdev.com/forums/p/13888/49351.aspx which has the solution I need. I believe I duplicated the SumRepList.xsn as Jimmy presented. However, in my case my secondary data comes from a SharePoint list. I noticed was Jimmy's secondary data source (product) is a field and my source is a group (from the SP list). Jimmy's formula was sum(product[@name = selectedItems]/@price) and mine is sum(SharePointListItem_RW[Title = computerhardware]/Price). SharePointListItem_RW is my secondary group. The error in verifying the formula I now receive is "SharePointListItem_RW/Title" does not point to a valid location path of a field or group. I'm not sure why as I selected it by choosing insert field or group. Many thanks in advance!
  • 04-28-2017 10:36 AM In reply to

    Re: Calculate Totals From Sharepoint List Repeating Table & Multiple-Selection List Box

    If you click Edit XPath in the formula window, what's the resulting XPath? Can you paste it in a reply?
    Hilary Stoupa

  • 04-28-2017 10:51 AM In reply to

    Re: Calculate Totals From Sharepoint List Repeating Table & Multiple-Selection List Box

    Hi, it is: sum(xdXDocument:GetDOM("Standard Hardware")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[xdXDocument:GetDOM("Standard Hardware")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Title = ../my:computerhardware]/xdXDocument:GetDOM("Standard Hardware")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Price) I now receive a node-test expected error. Thank you
  • 04-28-2017 10:56 AM In reply to

    Re: Calculate Totals From Sharepoint List Repeating Table & Multiple-Selection List Box

    Try this: sum(xdXDocument:GetDOM("Standard Hardware")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[d:Title = current()/../my:computerhardware]/d:Price)
    Hilary Stoupa

  • 04-28-2017 11:00 AM In reply to

    Re: Calculate Totals From Sharepoint List Repeating Table & Multiple-Selection List Box

    Oh my goodness, thank you!!!!!!! My eye just teared up ;-) You have made my weekend, I hope you have a great one!
  • 04-28-2017 11:29 AM In reply to

    Re: Calculate Totals From Sharepoint List Repeating Table & Multiple-Selection List Box

    Wonderful - glad that worked! The XPath filter (in the square brackets) indicates which repeating nodes you want from your data source. Current() refers to the node where we are putting the formula. :)
    Hilary Stoupa

  • 05-01-2017 11:14 AM In reply to

    Re: Calculate Totals From Sharepoint List Repeating Table & Multiple-Selection List Box

    Thanks again for your assistance Friday. Well, I'm trying to build on that success. I have a total of four multiple-selection list boxes for which I am calculating a total. I would like to calculate the sum all of these list box totals. All fields have a data type of decimal (double). The formula I'm using for the default value of my grand total field at this stage is hwprice + swprice. However, upon preview the grand total field is blank. Can the results of my lists box calculation be used in another calculation?
  • 05-01-2017 12:23 PM In reply to

    Re: Calculate Totals From Sharepoint List Repeating Table & Multiple-Selection List Box

    So hwprice & swprice are fields that are using similar defaults for their values? Do both fields have values if you put them on the form to take a look at them?
    Hilary Stoupa

  • 05-01-2017 12:53 PM In reply to

    Re: Calculate Totals From Sharepoint List Repeating Table & Multiple-Selection List Box

    Yes they are exactly the same. When I preview, the calculations are performed for each field and the sums are populated. I also set the total cost default value to hwprice once without any calculations and it was blank.
  • 05-01-2017 02:06 PM In reply to

    Re: Calculate Totals From Sharepoint List Repeating Table & Multiple-Selection List Box

    That seems very odd! Any chance you can attach a copy of your form under the Options tab in a reply?
    Hilary Stoupa

  • 05-01-2017 03:43 PM In reply to

    Re: Calculate Totals From Sharepoint List Repeating Table & Multiple-Selection List Box

    Hi, I will first thing tomorrow.
  • 05-02-2017 09:04 AM In reply to

    Re: Calculate Totals From Sharepoint List Repeating Table & Multiple-Selection List Box

    Here it is.
  • 05-02-2017 03:52 PM In reply to

    Re: Calculate Totals From Sharepoint List Repeating Table & Multiple-Selection List Box

    That is strange. I notice when I preview it, if I type in the Hardware cost, it shows in the total (as expected).
    Hilary Stoupa

  • 05-03-2017 10:12 AM In reply to

    Re: Calculate Totals From Sharepoint List Repeating Table & Multiple-Selection List Box

    Yes, it did it for me too when entering values directly into the hardware and software fields. This form I sent though was without the data connections. Previewing on the server, my list populates the hardware, software, etc boxes and when an item is selected its value appears in the hardware and software boxes but the total cost. It never populated with anything. It looks like the values aren't being passed to the total when they are not directly input (or in my case a result of a previous calculation). Thank you again.
  • 05-03-2017 10:19 AM In reply to

    Re: Calculate Totals From Sharepoint List Repeating Table & Multiple-Selection List Box

    Maybe try setting a rule on hwprice & swprice to set the total?
    Hilary Stoupa

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