Concatenating 2 repeating tables using ; if they contain data - InfoPath Dev
in

InfoPath Dev

Concatenating 2 repeating tables using ; if they contain data

Last post 02-18-2014 06:56 AM by zxkuqyb. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 12-06-2012 09:26 AM

    Concatenating 2 repeating tables using ; if they contain data

    Hi there,

    I have got 2 repeating tables which i am using Eval and Concat to calculate their value into a single line file.

    However now i need to combine both of these concatenated values together into a single text field depending on if they have data in them,

     So far i have.

    Repeating table values 1 - substring(eval(eval(Users, 'concat("; ", .)'), ".."), 2)

    Repeating table values 2 - substring(eval(eval(AdditionalUsers, 'concat("; ", .)'), ".."), 2)

    My Current Calculation:

    concat(substring(eval(eval(Users, 'concat("; ", .)'), ".."), 2), substring(eval(eval(AdditionalUsers, 'concat("; ", .)'), ".."), 2), ";") 

    This combines both of the above fields but places a ';' in the field even if 'Repeating Values 2' is blank.

    How can i have it so that it only puts a ';' in to seperate the values if 'Repeating Values 2' is not blank

     I am using Infopath 2003.

    Thanks in advance,

    Rich

     

  • 12-06-2012 01:37 PM In reply to

    Re: Concatenating 2 repeating tables using ; if they contain data

    How about this:

    substring(eval(eval(Users | AdditionalUsers, 'concat("; ", .)'), ".."), 2)

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-06-2012 02:51 PM In reply to

    Re: Concatenating 2 repeating tables using ; if they contain data

    That works great thanks Jimmy, i'm 99% there, the only problem now is that if i have a blank repeating dropdown group it still puts in a ";" in the concat field, it isn't until you delete the repeating group that the preceeding ";" disappears.

    I think that is clear.

    Cheers,

    Rich

  • 12-06-2012 08:26 PM In reply to

    Re: Concatenating 2 repeating tables using ; if they contain data

    substring(eval(eval((Users | AdditionalUsers)[. != ""], 'concat("; ", .)'), ".."), 2)
    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-11-2012 06:05 AM In reply to

    Re: Concatenating 2 repeating tables using ; if they contain data

    Hi Jimmy i got it working in the end by using the below formula. substring(eval(eval(Users[. != ""] | AdditionalUsers[. != ""], 'concat("; ", .)'), ".."), 2) If i used your formula the it would merge together the two data sources and break their independent links. Thanks for you help. Rich
  • 02-18-2014 06:56 AM In reply to

    • zxkuqyb
    • Not Ranked
      Male
    • Joined on 01-14-2009
    • Indianapolis, IN
    • Posts 18

    Re: Concatenating 2 repeating tables using ; if they contain data

    Great Post!  Thanks for the formula above.  I was looking for the exact same functionality and your solution worked perfectly for my situation.

    Thomas N. Barrett

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