Concat/Eval Formula Problem - InfoPath Dev
in

InfoPath Dev

Concat/Eval Formula Problem

Last post 03-04-2010 09:06 AM by Hilary Stoupa. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 03-03-2010 11:23 AM

    • Ayu222
    • Not Ranked
    • Joined on 03-03-2010
    • Posts 3

    Concat/Eval Formula Problem

    Good afternoon all, I'm pretty stuck on something, and after reviewing this site, it seems this is the best forum community to ask.

     Before I get started, I would like to say that I've already read through this forum as much as I could on this subject, and have (unfortunately) arrived at the problem which I will present to you now.

     I have read a number of resources (most discussed on this forum) including -but not limited to-:

     http://www.infopathdev.com/forums/p/7124/26114.aspx

    http://blogs.msdn.com/infopath/archive/2006/04/05/569338.aspx

    http://www.infopathdev.com/forums/p/7124/30263.aspx

     And still my problem persists.

    I've thrown together with GOOD OL' MSpaint a visual aiding collage (since I'm at my work desk, and image editing software isn't plentiful)

    Basically, there are only 2 fields that are in use (for now): Employees_involved_last_repeating and the Expression Box, outlined in dashes (for now ignore the Employees_involved_first_repeating)

    I have arrived at using the formula "eval(eval(person, "concat(my:email, ';')"), "..")" from the second link (in customized form of course)

    On a side note, I'm using Infopath 2003.

    Below you can see my data sources, the expression box, and the result of interaction.

     

    To explain further, when nothing is inserted into the repeating field the semicolon (;) is visible, which right away, I don't think (or hope) should be happening. When I add content into the first (initial) field, the contents "Input" fine into the expression box, and the result is "<content>;" (Again with the unneeded semicolon!). That itself doesn't bother me to the point of annoyance ..... Until another row is inserted, that's where the trouble REALLY begins. A new line, regardless of the contents, will create another semicolon with the FIRST field's content, looping through infinitely.

    Well I've been working on this issue for around 8 combined hours, and it seems that I've reached my ability's limits on this (I've just started using infopath around 3 days ago and am self taught) and look towards the community for their assistance in this matter.

     From the time of this post I will not be available to converse on any replies for a business day or two, so I hope that you don't mind leaving a message and possibly receiving a reply or input for a while.

    Again, thank you for the information that got me this far, and I apologize for asking for more, when I myself don't have much to give back in return.

     Sincerely,

          Ayu Leisen

     P.S. Sorry if this is the wrong forum category to place this.

  • 03-03-2010 01:35 PM In reply to

    Re: Concat/Eval Formula Problem

    Hi,

    Try just using a relative path like:

    concat(my:Employees_involved_lastrepeating, ";") ... etc

    instead of using the full path to the node. If you look back at the example that uses person and email, you'll see that person is the repeating parent of email....

    Oh, and just by posting questions you give back to the community, you know? Because people answer, and then we have the knowledge out where others can see it.

    That whole 'trailing semi colon' thing is an issue with this type of formula --you can probably be rid of it with some substring magic, but let's make sure you get the main formula working first before adding to the confusion.

    Hilary Stoupa

  • 03-04-2010 07:28 AM In reply to

    • Ayu222
    • Not Ranked
    • Joined on 03-03-2010
    • Posts 3

    Re: Concat/Eval Formula Problem

    Hilary Stoupa:

    Hi,

    Try just using a relative path like:

    concat(my:Employees_involved_lastrepeating, ";") ... etc

     It was definitely as you said, that my formula was too much expanded. The formula is working as it should, excluding the expected "Semicolon trailing." Even that, you've advised me towards the solution, so my initial problem is looking very much solved. Had InfoPath not automatically created the full path for me, I suppose this issue would never have surfaced. I feel foolish for not having noticed it, but alas.....

    My next follow up is to be... a bit tougher. I left the "Employees_involved_first_repeating" field visible in the picture purposely for the next inquiry: How would one go about concatenating the first and last name (both repeating tables, parallel) and then proceed to implement the aforementioned formula?  (Also, the order of first name/last name can be switched, I, nor the client mind (First/Last or Last/First))

    Thank you for supporting me on this matter, and hope that I can provide some assistance later in the future, when I become a bit better with InfoPath.

    As you've insightfully mentioned, I hope that this experience and the advice given helps another -like minded- InfoPath'er with similar troubles.

  • 03-04-2010 08:23 AM In reply to

    Re: Concat/Eval Formula Problem

    Well, since you have the basic formula working now, I'd try:

    concat(concat(my:Employees_involved_firstrepeating, " " ,my:Employees_involved_lastrepeating), ";") ... etc

    So you know -- I haven't actually tested using a concat inside a double eval before, but I can't think of why it wouldn't work.... perhaps give it a try and report back?

    Hilary Stoupa

  • 03-04-2010 08:50 AM In reply to

    • Ayu222
    • Not Ranked
    • Joined on 03-03-2010
    • Posts 3

    Re: Concat/Eval Formula Problem

    Hilary Stoupa:

    Well, since you have the basic formula working now, I'd try:

    concat(concat(my:Employees_involved_firstrepeating, " " ,my:Employees_involved_lastrepeating), ";") ... etc

    So you know -- I haven't actually tested using a concat inside a double eval before, but I can't think of why it wouldn't work.... perhaps give it a try and report back?

     Your formula works correctly, kudos! I will outline the formula for anyone else who is curious in how this works.

     eval(eval(Rep_group, 'concat(concat(my:Employees_involved_first_repeating, " ", my:Employees_involved_last_repeating), ";")'), "..")

    I will proceed to finish the formula with the substring function to truncate the semicolon at the end, and if time permits, modify or add to this post/thread the details.

     I have to thank you, not only for your patience, but because you've done a fantastic job helping me complete my work.

  • 03-04-2010 09:06 AM In reply to

    Re: Concat/Eval Formula Problem

    Glad to have helped, and thanks for posting your results!

    Hilary Stoupa

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