Escaping a single quotation mark - InfoPath Dev
in

InfoPath Dev

Escaping a single quotation mark

Last post 02-02-2009 03:17 PM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-02-2009 11:50 AM

    Escaping a single quotation mark

    This is my formula I'm trying to insert into a field and it won't allow me to input the single quotation marks, please help.

     

    eval(eval(group2, 'concat(my:field3, "', '")'), "..")

     Right where the comma is I have double quotes followed by a single quotation mark then a comma then another sinlge quote and then double quotes, so my end result would be to have this field contain a list somewhat like this..

     'Item1', 'Item2', 'Item3', 'Item4'.....ect.

  • 02-02-2009 03:17 PM In reply to

    Re: Escaping a single quotation mark

    Hi:

    You could use a different character to separate your items, like a % or something, then use translate to replace that with ', ':

    translate(eval(eval(group2, 'concat(my:field3, "%, %")'), ".."), "%", "'")

    for example. Of course, getting your opening ' will take another concatenation:

    concat("'", translate(xdMath:Eval(xdMath:Eval(my:group1/my:group2, 'concat(my:field3, "%, %")'), ".."), "%", "'"))

    The trick would be to use a character that the entries won't have -- not too bad if the field uses a drop down list, but a bit tougher if the user can enter whatever he or she likes....

    Hilary Stoupa

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