Problem with displaying repeating text box in an email subject / attachment name, upon form submission - InfoPath Dev Sign in | Join | Help in Data Connections 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 » Data Connections » Problem with displaying repeating text box in an email subject / attachment name, upon form submission Problem with displaying repeating text box in an email subject / attachment name, upon form submission Last post 09-08-2010 10:03 AM by ncarson. 23 replies. Page 2 of 2 (24 items) < Previous 1 2 Sort Posts: Oldest to newest Newest to oldest Previous Next 07-14-2008 07:54 AM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: Problem with displaying repeating text box in an email subject / attachment name, upon form submission Mark as Not AnswerMark as Answer... Reply Contact Again, you have an error with your parentheses. You have closed the parentheses for the substring function, but not for the concat function. The error is saying 'Hey, weren't you concatenating here? Did you want to add another value?' It's looking for a comma and another value, and a closing parenthesis. There is a great, free notepad replacement that has parentheses matching that I love for tracking down errors like these -- it is available here: http://www.flos-freeware.ch/notepad2.html Hilary Stoupa 07-14-2008 08:33 AM In reply to e_stylzz Joined on 07-11-2008 DE Posts 55 Re: Problem with displaying repeating text box in an email subject / attachment name, upon form submission Mark as Not AnswerMark as Answer... Reply Contact I'm sorry but I'm not sure I follow.I took the first sample you sent me and it worked just fine: eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), "..")When I applied that to your next line of code : substring(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), ".."), 1, string-length(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), "..") - 3) is when I got that error message.So you are saying I'm supposed to add another value in that concat line even though I didn't have to in the first example? I will want to concat another value but it's not part of the group or repeating section so I dont think it should do in this section. Should I not use concat if I only want to have name, name, name then another value out of the set? This works except for the 3 characters but is very similar to what i want it to do: concat(substring(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), ".."), 1, string-length(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), "..") - 3)), " - ", tbClientName) I am going to download that editor now however, thanks for the advice. 07-14-2008 08:49 AM In reply to e_stylzz Joined on 07-11-2008 DE Posts 55 Re: Problem with displaying repeating text box in an email subject / attachment name, upon form submission Mark as Not AnswerMark as Answer... Reply Contact Ohhhhhh!!!!!I need to put that extra parenthesis in front of the -3 like this:concat(substring(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), ".."), 1, string-length(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), "..")) - 3), " - ", tbClientName) It seems to be working anyway. Thanks so much!! 07-14-2008 08:56 AM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: Problem with displaying repeating text box in an email subject / attachment name, upon form submission Mark as Not AnswerMark as Answer... Reply Contact Your second fomula you are showing: substring(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), ".."), 1, string-length(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), "..") - 3) Should be: substring(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), ".."), 1, string-length(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), ".." )) - 3) Your last formula: concat(substring(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), ".."), 1, string-length(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), "..") - 3)), " - ", tbClientName) Should be: concat(substring(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), ".."), 1, string-length(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), ".." )) - 3), " - ", tbClientName) The reason you were only getting 3 characters returned is because of the way you have your closing parenthesis. Hilary Stoupa 07-14-2008 10:15 AM In reply to e_stylzz Joined on 07-11-2008 DE Posts 55 Re: Problem with displaying repeating text box in an email subject / attachment name, upon form submission Mark as Not AnswerMark as Answer... Reply Contact Everything has been working great. Thanks again for all your help. That notepad2 is very helpful. 07-14-2008 10:25 AM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: Problem with displaying repeating text box in an email subject / attachment name, upon form submission Mark as Not AnswerMark as Answer... Reply Contact Great -- glad you have it all working. Yes, Notepad2 is *wonderful* for figuring out where all your parentheses go. Also, it has syntax highlighting availble, so if you open an XML file (for example) with it, it is easier to read. Hilary Stoupa 09-08-2010 08:21 AM In reply to ncarson Joined on 05-04-2010 Posts 26 Re: Problem with displaying repeating text box in an email subject / attachment name, upon form submission Mark as Not AnswerMark as Answer... Reply Contact Hilary - I have a similar problem that I can't seem to get to work and thought maybe you could help me. I have a Repeating Table and I want the row contents concatenated and separated by a comma but not have a comma at the end of the string. My datasource is set up like this: MainmyFields EventPage (Folder) EventInfo (Folder) LawyerRoles (Folder) SpkrsGrp (Folder) SpeakersGroup (REPEATING GROUP) LawyersSpeaking (TEXT FIELD) xPath properties of Repeating Group: /my:myFields/my:EventPage/my:EventInfo/my:LawyerRoles/my:SpkrsGrp/my:SpeakersGroup xPath properties of Text Field: /my:myFields/my:EventPage/my:EventInfo/my:LawyerRoles/my:SpkrsGrp/my:SpeakersGroup/my:LawyersSpeaking The Text Field (Lawyers Speaking) is a Drop-Down List Box connected to an external data connection so a user can select from a dynamic database of names and there is no limit to the number that can be selected, but in most cases probably won't be more than 6-8 names. I added a text box and for the Properties I inserted this formula: substring(eval(eval(SpeakersGroup, 'concat(/my:myFields/my:EventPage/my:EventInfo/my:LawyerRoles/my:SpkrsGrp/my:SpeakersGroup/my:LawyersSpeaking, ", ")'), ".."), 1, string-length(eval(eval(SpeakersGroup, 'concat(/my:myFields/my:EventPage/my:EventInfo/my:LawyerRoles/my:SpkrsGrp/my:SpeakersGroup/my:LawyersSpeaking, ", ")'), "..") - 2)) I know there's an extra closed paren at the end than on your formula, but I kept getting an error asking for an "end of string" so after adding the last paren InfoPath accepted the formula without any errors. Only thing is all the field gets from this is the first three characters of the first name selected. Can you give me any guidance? Filed under: repeating table, infopath 2007 09-08-2010 09:20 AM In reply to Jimmy Joined on 07-03-2008 Posts 2,595 Re: Problem with displaying repeating text box in an email subject / attachment name, upon form submission Mark as Not AnswerMark as Answer... Reply Contact You're missing a parenthesis before the minus sign and that's why you had to append one to the end. That's most likely the reason you're only getting three characters. There's a simpler formula to eliminate the extraneous separator character. It's: substring(eval(eval(RepeatingGroup, 'concat(", ", FieldToConcatenate)'), '..'), 3) You also shouldn't be using an absolute XPath in your concat statement. How's this? substring(eval(eval(SpeakersGroup, 'concat(", ", my:LawyersSpeaking)'), ".."), 3) Jimmy Rishe / Software Developer / Microsoft MVPQdabra Software 09-08-2010 10:03 AM In reply to ncarson Joined on 05-04-2010 Posts 26 Re: Problem with displaying repeating text box in an email subject / attachment name, upon form submission Mark as Not AnswerMark as Answer... Reply Contact The "simpler formula" you provided (first example above) did it! I cannot thank you enough. I've spent an unbelievable amount of hours trying to do this. Next time I won't wait so long before raising the flag and asking for help. Jimmy, you are my hero! Page 2 of 2 (24 items) < Previous 1 2 Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
Again, you have an error with your parentheses. You have closed the parentheses for the substring function, but not for the concat function. The error is saying 'Hey, weren't you concatenating here? Did you want to add another value?' It's looking for a comma and another value, and a closing parenthesis.
There is a great, free notepad replacement that has parentheses matching that I love for tracking down errors like these -- it is available here: http://www.flos-freeware.ch/notepad2.html
I'm sorry but I'm not sure I follow.
I took the first sample you sent me and it worked just fine: eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), "..")
When I applied that to your next line of code : substring(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), ".."), 1, string-length(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), "..") - 3) is when I got that error message.
So you are saying I'm supposed to add another value in that concat line even though I didn't have to in the first example? I will want to concat another value but it's not part of the group or repeating section so I dont think it should do in this section. Should I not use concat if I only want to have name, name, name then another value out of the set?
This works except for the 3 characters but is very similar to what i want it to do:
concat(substring(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), ".."), 1, string-length(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), "..") - 3)), " - ", tbClientName)
I am going to download that editor now however, thanks for the advice.
Ohhhhhh!!!!!
I need to put that extra parenthesis in front of the -3 like this:
concat(substring(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), ".."), 1, string-length(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), "..")) - 3), " - ", tbClientName)
It seems to be working anyway.
Thanks so much!!
Your second fomula you are showing:
substring(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), ".."), 1, string-length(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), "..") - 3)
Should be:
substring(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), ".."), 1, string-length(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), ".." )) - 3)
Your last formula:
concat(substring(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), ".."), 1, string-length(eval(eval(rsResourceName, 'concat(my:tbResourceName2, " , ")'), ".." )) - 3), " - ", tbClientName)
The reason you were only getting 3 characters returned is because of the way you have your closing parenthesis.
Everything has been working great. Thanks again for all your help. That notepad2 is very helpful.
Great -- glad you have it all working. Yes, Notepad2 is *wonderful* for figuring out where all your parentheses go. Also, it has syntax highlighting availble, so if you open an XML file (for example) with it, it is easier to read.
Hilary - I have a similar problem that I can't seem to get to work and thought maybe you could help me. I have a Repeating Table and I want the row contents concatenated and separated by a comma but not have a comma at the end of the string. My datasource is set up like this:
MainmyFields EventPage (Folder) EventInfo (Folder) LawyerRoles (Folder) SpkrsGrp (Folder) SpeakersGroup (REPEATING GROUP) LawyersSpeaking (TEXT FIELD)
xPath properties of Repeating Group: /my:myFields/my:EventPage/my:EventInfo/my:LawyerRoles/my:SpkrsGrp/my:SpeakersGroup
xPath properties of Text Field: /my:myFields/my:EventPage/my:EventInfo/my:LawyerRoles/my:SpkrsGrp/my:SpeakersGroup/my:LawyersSpeaking
The Text Field (Lawyers Speaking) is a Drop-Down List Box connected to an external data connection so a user can select from a dynamic database of names and there is no limit to the number that can be selected, but in most cases probably won't be more than 6-8 names.
I added a text box and for the Properties I inserted this formula:
substring(eval(eval(SpeakersGroup, 'concat(/my:myFields/my:EventPage/my:EventInfo/my:LawyerRoles/my:SpkrsGrp/my:SpeakersGroup/my:LawyersSpeaking, ", ")'), ".."), 1, string-length(eval(eval(SpeakersGroup, 'concat(/my:myFields/my:EventPage/my:EventInfo/my:LawyerRoles/my:SpkrsGrp/my:SpeakersGroup/my:LawyersSpeaking, ", ")'), "..") - 2))
I know there's an extra closed paren at the end than on your formula, but I kept getting an error asking for an "end of string" so after adding the last paren InfoPath accepted the formula without any errors.
Only thing is all the field gets from this is the first three characters of the first name selected. Can you give me any guidance?
You're missing a parenthesis before the minus sign and that's why you had to append one to the end. That's most likely the reason you're only getting three characters.
There's a simpler formula to eliminate the extraneous separator character. It's:
substring(eval(eval(RepeatingGroup, 'concat(", ", FieldToConcatenate)'), '..'), 3)
You also shouldn't be using an absolute XPath in your concat statement. How's this?
substring(eval(eval(SpeakersGroup, 'concat(", ", my:LawyersSpeaking)'), ".."), 3)
The "simpler formula" you provided (first example above) did it! I cannot thank you enough. I've spent an unbelievable amount of hours trying to do this. Next time I won't wait so long before raising the flag and asking for help. Jimmy, you are my hero!