What if you do not need to do any concating
I need to compare what I have in a field with what is in a custom list. I also need to translate both into lower case so they match. Here is what I have:
translate(my:myFields/my:MyCurrentUser, "ABCDEFGHIJKLMNOPQRSTUVWYXZ", "abcdefghijklmnopqrstuvwyxz") = eval(eval(/dfs:myFields/dfs:dataFields/dfs:SustainApprovers, "translate(my:myFields/my:dataFields/my:Person, 'ABCDEFGHIJKLMNOPQRSTUVWYXZ', 'abcdefghijklmnopqrstuvwyxz')",".."))
I get an error when the form loads.
Thanks for any help
This is wonderful! It works beautifully for me. However, I do have a question...is there any way we can add a carriage return after each entry?
Right now I have this:
eval(eval(User_Details, 'concat(my:Full_User_Name, ";")'), "..")
and rather than having each name in the same row in my text box, I'd like them to be in seperate rows, like the repeating table.
If you just want the e-mail addresses to be on separate lines in a text box, then take a look at this post: blogs.msdn.com/.../385577.aspx
You will need to create that file and add it to your XSN. Then in the expression for concatenating the emails, you will remove the ";" from the expression and select the "crlf" option from this new data connection. It is important that you actually select that item and not just hand enter it. In the end, your expression will look like this when you initially select it:
eval(eval(eval(attendee[selected = string(true())]/attendeeEmail, "."), 'concat(., @crlf)'), "..")
Once you click the Verify formula button, it will look like this:
eval(eval(eval(attendee[selected = string(true())]/attendeeEmail, "."), 'concat(., xdXDocument:GetDOM("Characters")/characters/@crlf)'), "..")
NOTE: This will only work if you are using the InfoPath client to open your forms. If you are using the browser, the only way to do this is with code.
One last item: in order for your text box to reflect these on different lines, you will need to enable the "Multi-Line" property of the text box.
Very helpful - works like a charm! In my case, I was using a repeating table with only one column, and needed all the values chosen concatenated into a separate field. This solution worked well. Thanks,
Thanks Scott, I'll give it a go. I was aware of the carriage return xml file (and am using it in non-repeating tables), but I couldn't get it to work with this eval function.
I have tried this method however the value returned is only the first value of the repeating array.
Example, Name = Mary, John, Ken
Value returned = Mary; Mary; Mary
Its note worthy that the field the value is returned to is within the footer of the repeating table. I'm not sure if this makes a difference. I will test some more.
Hi there, and thank you for a fantastic post! The only thing is that I also, just like Greg, get the first value repeated instead of the individual values... Any ideas?
Thanks a lot for your suggestion on how to eliminate the last ";" in one of the replies able. You really saved me.
I've tried to replace the repeating group with one from a SharePoint list. Can anyone shed some light on this?
Good day Scott,
I have found your description above to be exactly what I was looking for. I also read through the blog below, and discovered I encounter the same error as Debb66 has. You have referred her to ther IT team.
Was there ever any resolution found to this?
Unfortunatley my IT team won't support InfoPath queries and troubleshooting. So I am at the mercy of my findings here.
Can you assist me, please?
Hi Charles M,
Can you share with me what "error" you are referring to?
My DataSource Looks like this:
On this form, I have a one-cell table. This cell contains a repeating table with a single textbox field. Emails are typed in this field.
Below this repeating table, I have a single text box that I wish to concatenate all the emails entered in the repeating table above.
This is the formula entered as the DefaultValue of this textbox field:
eval(eval(RecipientRepeatingTable, "concat(CCRecipient, ';')"), "..")
This is the error returned when this formula is validated:
"../my:RecipientColumn/my:RecipientColumn/my:RecipientRepeatingTable/my:CCRecipient" does not point to a valid location path of a field or group.
Thank you for the clarification. So I setup a sample XSN like this:
RecipientColumn (Group, non-repeating)
RecipientRepeatingTable (Group, repeating)
CCRecipient (Field, Text data type, non-repeating)
EmailRecipients (Field, Text data type, non-repeating)
If your data source is setup like this, here is the XPath expression you will need as the Default Value for the "EmailRecipients" field (note: I clicked the "Edit XPath" check box in the formula box so you could see the entire expression):
xdMath:Eval(xdMath:Eval(xdMath:Eval(../my:RecipientColumn/my:RecipientRepeatingTable/my:CCRecipient, "."), 'concat(., ";")'), "..")
What this looks like without the "Edit XPath" checked is this:
eval(eval(eval(CCRecipient, "."), 'concat(., ";")'), "..")
So if your data source is indeed exactly what I have described above, you can copy/paste the expanded version of the expression above directly into your XSN.
I hope this helps!
I was just looking for this formula to send multiple email from repeating table and this information is very useful. Thank you.