writing values from a multiple-selection list box to another control - InfoPath Dev Sign in | Join | Help in Controls InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » Controls » writing values from a multiple-selection list box to another control writing values from a multiple-selection list box to another control Last post 07-12-2019 08:58 AM by Hilary Stoupa. 72 replies. Page 3 of 5 (73 items) < Previous 1 2 3 4 5 Next > Sort Posts: Oldest to newest Newest to oldest Previous Next 03-27-2013 07:57 AM In reply to supermanKelz Joined on 03-20-2013 Posts 7 Re: writing values from a multiple-selection list box to another control Mark as Not AnswerMark as Answer... Reply Contact Jimmy,How did you filter the data for the Display name calculated value field? I can get the ListItem[ Value = field1] part entered, but I can seem to figure out how to got /Display as part of the formula.I set up my fields such that ListItem is DS_Choice_ListItems, Value is field67, and Display is field68. field1 is DataSources choice group.eval(eval(ListItem[Value = field1]/Display, 'concat(., "; ")'), "..") 03-27-2013 12:13 PM In reply to Jimmy Joined on 07-03-2008 Posts 2,595 Re: writing values from a multiple-selection list box to another control Mark as Not AnswerMark as Answer... Reply Contact Hello supermanKelz, Could you attach a screenshot of the relevant data source(s) involved in this formula, and paste the entire actual formula you've been trying (with the Edit XPath box checked), and explain what the specific issue you're encountering is (error message, etc.)? Jimmy Rishe / Software Developer / Microsoft MVPQdabra Software 03-29-2013 04:29 AM In reply to InfoPathBeginner Joined on 01-09-2012 Posts 6 Re: writing values from a multiple-selection list box to another control Mark as Not AnswerMark as Answer... Reply Contact HI Jimmy , This XPATH Rules dont work when we used List Form Template ? Thanks in advance 03-29-2013 08:43 AM In reply to Jimmy Joined on 07-03-2008 Posts 2,595 Re: writing values from a multiple-selection list box to another control Mark as Not AnswerMark as Answer... Reply Contact Hi InfoPathBeginner, I do not have a lot experience with list forms, but I believe it should work even with them. Have you been experiencing an issue trying to get it to work? Jimmy Rishe / Software Developer / Microsoft MVPQdabra Software 04-22-2013 04:29 AM In reply to bhben Joined on 08-21-2012 Posts 5 Re: writing values from a multiple-selection list box to another control Mark as Not AnswerMark as Answer... Reply Contact Hi,I am attempting to do pretty much the same action as described the original post but I can't get it to work correctly. I have tried using the sample template but have been unsuccessful.I have a Multiple-Selection List Box called SelectedPartnerAgencies and I want the selected agencies to be added to the value of a text box (called PartnerAgenciesTextBox). The MSLB is populated from a secondary data source and is set to only show filtered items based on a different field. I have created a rule on the MSLB with the following expression:substring(eval(eval(SelectedPartnerAgencies[. != ""], 'concat(";", .)'), ".."), 2)XPath: substring(xdMath:Eval(xdMath:Eval(../my:SelectedPartnerAgencies[. != ""], 'concat(";", .)'), ".."), 2)I have the following rule as the default value of the text box (identical to above):substring(eval(eval(SelectedPartnerAgencies[. != ""], 'concat(";", .)'), ".."), 2)XPath: substring(xdMath:Eval(xdMath:Eval(../my:group3/my:SelectedPartnerAgencies[. != ""], 'concat(";", .)'), ".."), 2)The text box is set to refresh value after formula is recalculated.The text box is only populated after I have selected mulitple items then unselect an item - i.e. it rarely shows an accurate reflection of what is selected in the MSLB.I'm using InfoPath 2010 (Filler) form. The form is saved to a SharePoint 2010 library.Any help would be much appreciated.Thanks, Ben. 04-22-2013 05:31 AM In reply to Jimmy Joined on 07-03-2008 Posts 2,595 Re: writing values from a multiple-selection list box to another control Mark as Not AnswerMark as Answer... Reply Contact It sounds like the rule isn't working. Where did you place the rule exactly? Is it on the MSLB's group, or on the repeating field? It should be placed on the repeating field. Jimmy Rishe / Software Developer / Microsoft MVPQdabra Software 04-22-2013 11:24 AM In reply to supermanKelz Joined on 03-20-2013 Posts 7 Re: writing values from a multiple-selection list box to another control Mark as Not AnswerMark as Answer... Reply Contact In your XPath's, you have to refer to the current field as it's full name, not " . " Replace with: substring(xdMath:Eval(xdMath:Eval(my:myFields/my:SelectedPartnerAgencies[. != ""], 'concat(";", .)'), ".."), 2) bhben:Hi,I am attempting to do pretty much the same action as described the original post but I can't get it to work correctly. I have tried using the sample template but have been unsuccessful.I have a Multiple-Selection List Box called SelectedPartnerAgencies and I want the selected agencies to be added to the value of a text box (called PartnerAgenciesTextBox). The MSLB is populated from a secondary data source and is set to only show filtered items based on a different field. I have created a rule on the MSLB with the following expression:substring(eval(eval(SelectedPartnerAgencies[. != ""], 'concat(";", .)'), ".."), 2)XPath: substring(xdMath:Eval(xdMath:Eval(../my:SelectedPartnerAgencies[. != ""], 'concat(";", .)'), ".."), 2)I have the following rule as the default value of the text box (identical to above):substring(eval(eval(SelectedPartnerAgencies[. != ""], 'concat(";", .)'), ".."), 2)XPath: substring(xdMath:Eval(xdMath:Eval(../my:group3/my:SelectedPartnerAgencies[. != ""], 'concat(";", .)'), ".."), 2)The text box is set to refresh value after formula is recalculated.The text box is only populated after I have selected mulitple items then unselect an item - i.e. it rarely shows an accurate reflection of what is selected in the MSLB.I'm using InfoPath 2010 (Filler) form. The form is saved to a SharePoint 2010 library.Any help would be much appreciated.Thanks, Ben. 04-23-2013 07:14 AM In reply to bhben Joined on 08-21-2012 Posts 5 Re: writing values from a multiple-selection list box to another control Mark as Not AnswerMark as Answer... Reply Contact Unfortunately that hasn't worked, I get the following error message:"my:myFields/my:SelectedPartnerAgencies" does not point to a valid location path of a field or group.I've never directly edited XPath before so apologies if its something really obvious that i'm missing here.In response to previous post my rule is on the field part fo the control, not the group. The group is called group3. Do i need to reference 'group3' in the XPath? I did experiment trying to do this but still couldn't get it to work. I tried using your formula on the MSLB rule and the text box's default value, but neither worked. Thanks for your help. 01-23-2014 02:50 AM In reply to holdemryan Joined on 01-23-2014 Posts 9 Re: writing values from a multiple-selection list box to another control Mark as Not AnswerMark as Answer... Reply Contact Hi, I've used Jimmy's sample on Page 1 for the solution I'm looking for, however I'm hitting a different issue. The MSLB data source comes from an external source, if that makes a difference.The selected values are adding and removing from the text box just fine, however I get a ";" appear before any selections are made, and then my selections are not being separated by a ";" when more than one selection is made so the values are appearing in one long unseparated string in the text box.Just to confirm, this is the code I'm using in both the rule and the default value.substring(xdMath:Eval(xdMath:Eval(../../my:group1[. != ""], 'concat(";", .)'), ".."), 2) Any help with this is much appreciated! 01-23-2014 09:05 PM In reply to Jimmy Joined on 07-03-2008 Posts 2,595 Re: writing values from a multiple-selection list box to another control Mark as Not AnswerMark as Answer... Reply Contact Is group1 the field that the MSLB is bound to, or is it a group higher up in the data source? Jimmy Rishe / Software Developer / Microsoft MVPQdabra Software 01-24-2014 03:58 AM In reply to holdemryan Joined on 01-23-2014 Posts 9 Re: writing values from a multiple-selection list box to another control Mark as Not AnswerMark as Answer... Reply Contact Hi,group1 is from an external datasource, there's a :Value underneath it. but when I change the xpath to ../my:group1/value or ../my:group1/my:value then I get an error saying it's not a valid path. I thought VALUE was just the value of the selection as opposed to the displayname...if this makes sense! 01-27-2014 07:18 AM In reply to holdemryan Joined on 01-23-2014 Posts 9 Re: writing values from a multiple-selection list box to another control Mark as Not AnswerMark as Answer... Reply Contact Never fear, seems to be working now. Think it must have been case sensitive and perhaps I was using lower case v on Value. It now works perfectly on my list form. Thanks for the resource. 03-19-2014 06:59 AM In reply to mdroschak Joined on 03-19-2014 Posts 4 Re: writing values from a multiple-selection list box to another control ScreenShot.png Mark as Not AnswerMark as Answer... Reply Contact I'm trying to get this example to work in my form but am having issues. I have a MSLB with a secondary data source connection and want to show the selected display names in another field. This is the xpath I've come up with so far:xdMath:Eval(xdMath:Eval(xdXDocument:GetDOM("CORE Telephone Directory")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[d:Email = /my:myFields/my:AddAttendeeGroup/my:AddAttendees]/d:Email, 'concat(., "; ")'), "..") InfoPath shows no errors when verifying the formula, but when I test it out in preview the field remains blank Can anyone assist me with this? 03-19-2014 07:44 AM In reply to jaxkookie Joined on 05-02-2007 jacksonville FL Posts 187 Re: writing values from a multiple-selection list box to another control EvalSample 2010-08-10.xsn Mark as Not AnswerMark as Answer... Reply Contact I am attaching an example, it shows several ways to accomplish what you are trying to do. save the xsn and look it over. preview it and you can see how it works Kind regards,Larry 03-19-2014 12:46 PM In reply to mdroschak Joined on 03-19-2014 Posts 4 Re: writing values from a multiple-selection list box to another control Mark as Not AnswerMark as Answer... Reply Contact Thanks Larry for your response. I was finally able to figure out what the xpath should look like with a secondary data connection. xdMath:Eval(xdMath:Eval(xdXDocument:GetDOM("CORE Telephone Directory")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[d:Email = xdXDocument:get-DOM()/my:myFields/my:AddAttendeeGroup/my:AddAttendees]/d:Full_x0020_Name, 'concat(., "; ")'), "..") Page 3 of 5 (73 items) < Previous 1 2 3 4 5 Next > Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
Jimmy,
How did you filter the data for the Display name calculated value field? I can get the ListItem[ Value = field1] part entered, but I can seem to figure out how to got /Display as part of the formula.
I set up my fields such that ListItem is DS_Choice_ListItems, Value is field67, and Display is field68. field1 is DataSources choice group.
eval(eval(ListItem[Value = field1]/Display, 'concat(., "; ")'), "..")
Hello supermanKelz,
Could you attach a screenshot of the relevant data source(s) involved in this formula, and paste the entire actual formula you've been trying (with the Edit XPath box checked), and explain what the specific issue you're encountering is (error message, etc.)?
Hi InfoPathBeginner,
I do not have a lot experience with list forms, but I believe it should work even with them. Have you been experiencing an issue trying to get it to work?
Hi,
I am attempting to do pretty much the same action as described the original post but I can't get it to work correctly. I have tried using the sample template but have been unsuccessful.
I have a Multiple-Selection List Box called SelectedPartnerAgencies and I want the selected agencies to be added to the value of a text box (called PartnerAgenciesTextBox). The MSLB is populated from a secondary data source and is set to only show filtered items based on a different field. I have created a rule on the MSLB with the following expression:
substring(eval(eval(SelectedPartnerAgencies[. != ""], 'concat(";", .)'), ".."), 2)
XPath: substring(xdMath:Eval(xdMath:Eval(../my:SelectedPartnerAgencies[. != ""], 'concat(";", .)'), ".."), 2)
I have the following rule as the default value of the text box (identical to above):
XPath: substring(xdMath:Eval(xdMath:Eval(../my:group3/my:SelectedPartnerAgencies[. != ""], 'concat(";", .)'), ".."), 2)
The text box is set to refresh value after formula is recalculated.
The text box is only populated after I have selected mulitple items then unselect an item - i.e. it rarely shows an accurate reflection of what is selected in the MSLB.
I'm using InfoPath 2010 (Filler) form. The form is saved to a SharePoint 2010 library.
Any help would be much appreciated.
Thanks, Ben.
bhben:Hi,I am attempting to do pretty much the same action as described the original post but I can't get it to work correctly. I have tried using the sample template but have been unsuccessful.I have a Multiple-Selection List Box called SelectedPartnerAgencies and I want the selected agencies to be added to the value of a text box (called PartnerAgenciesTextBox). The MSLB is populated from a secondary data source and is set to only show filtered items based on a different field. I have created a rule on the MSLB with the following expression:substring(eval(eval(SelectedPartnerAgencies[. != ""], 'concat(";", .)'), ".."), 2)XPath: substring(xdMath:Eval(xdMath:Eval(../my:SelectedPartnerAgencies[. != ""], 'concat(";", .)'), ".."), 2)I have the following rule as the default value of the text box (identical to above):substring(eval(eval(SelectedPartnerAgencies[. != ""], 'concat(";", .)'), ".."), 2)XPath: substring(xdMath:Eval(xdMath:Eval(../my:group3/my:SelectedPartnerAgencies[. != ""], 'concat(";", .)'), ".."), 2)The text box is set to refresh value after formula is recalculated.The text box is only populated after I have selected mulitple items then unselect an item - i.e. it rarely shows an accurate reflection of what is selected in the MSLB.I'm using InfoPath 2010 (Filler) form. The form is saved to a SharePoint 2010 library.Any help would be much appreciated.Thanks, Ben.
Unfortunately that hasn't worked, I get the following error message:
"my:myFields/my:SelectedPartnerAgencies" does not point to a valid location path of a field or group.
I've never directly edited XPath before so apologies if its something really obvious that i'm missing here.
In response to previous post my rule is on the field part fo the control, not the group. The group is called group3. Do i need to reference 'group3' in the XPath? I did experiment trying to do this but still couldn't get it to work. I tried using your formula on the MSLB rule and the text box's default value, but neither worked.
Thanks for your help.
Hi, I've used Jimmy's sample on Page 1 for the solution I'm looking for, however I'm hitting a different issue. The MSLB data source comes from an external source, if that makes a difference.
The selected values are adding and removing from the text box just fine, however I get a ";" appear before any selections are made, and then my selections are not being separated by a ";" when more than one selection is made so the values are appearing in one long unseparated string in the text box.
Just to confirm, this is the code I'm using in both the rule and the default value.
substring(xdMath:Eval(xdMath:Eval(../../my:group1[. != ""], 'concat(";", .)'), ".."), 2)
Any help with this is much appreciated!
Is group1 the field that the MSLB is bound to, or is it a group higher up in the data source?
group1 is from an external datasource, there's a :Value underneath it. but when I change the xpath to ../my:group1/value or ../my:group1/my:value then I get an error saying it's not a valid path.
I thought VALUE was just the value of the selection as opposed to the displayname...if this makes sense!
I'm trying to get this example to work in my form but am having issues. I have a MSLB with a secondary data source connection and want to show the selected display names in another field. This is the xpath I've come up with so far:
xdMath:Eval(xdMath:Eval(xdXDocument:GetDOM("CORE Telephone Directory")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[d:Email = /my:myFields/my:AddAttendeeGroup/my:AddAttendees]/d:Email, 'concat(., "; ")'), "..")
InfoPath shows no errors when verifying the formula, but when I test it out in preview the field remains blank
Can anyone assist me with this?
I am attaching an example, it shows several ways to accomplish what you are trying to do. save the xsn and look it over. preview it and you can see how it works
Thanks Larry for your response. I was finally able to figure out what the xpath should look like with a secondary data connection.
xdMath:Eval(xdMath:Eval(xdXDocument:GetDOM("CORE Telephone Directory")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[d:Email = xdXDocument:get-DOM()/my:myFields/my:AddAttendeeGroup/my:AddAttendees]/d:Full_x0020_Name, 'concat(., "; ")'), "..")