Eval / Concat / Substring Nested Functions - InfoPath 2010 - InfoPath Dev
in

InfoPath Dev

Eval / Concat / Substring Nested Functions - InfoPath 2010

Last post 12-19-2014 04:09 AM by Tughsol. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 12-11-2014 08:40 AM

    Eval / Concat / Substring Nested Functions - InfoPath 2010

    Hi,

    Sorry if this has already been asked. I tried seraching the forum but couldnt find a similar post. 

    I have an InfoPath Form with a Repeating Table which contains a Date control and a Check Box. 

    I need to perform a Concat on all of the Date fields where the Check Box is false / unchecked. This is a simple enough process using a combination of Eval and Concat but the issue I have is with the format of the actual Dates. They are displaying in YYYY-MM-DD - I may be wrong but I believe this is the standard format used by XML. 

    In the past I have then used the Substring Function in order to extract the individual Day, Month, Year values and then Concat them together. I'm having a much harder time trying to nest this with the Eval function though. I think I'm pretty close (if this is even possible) but I think my syntax is a little off towards the end. What I have so far is as below where DATE and SIG_BOX are my fields:

    eval(eval(DATE, 'concat(substring(DATE[SIG_BOX = string(false())], 9, 2), "/", substring(DATE[SIG_BOX = string(false())], 6, 2), "/", substring(DATE[SIG_BOX = string(false())], 1, 4)), " ")'), ".."

    I have used these functions seperately numerous times before (even if I dont fully understand them) but never all 3 nested like this. Does anyone know where I might be going wrong here?

    Thanks for any help you can give me.

     

  • 12-19-2014 04:09 AM In reply to

    Re: Eval / Concat / Substring Nested Functions - InfoPath 2010

    Think I almost have this sorted. I decided to build the formula bit by bit to try and test where I was going wrong - still not quite sure where I did go wrong!

    I currently have the formula below:

    eval(eval(REPEATING GROUP, 'concat(substring(my:DATE[../my:SIG_BOX = string(false())], 9, 2), "/", substring(my:DATE[../my:SIG_BOX = string(false())], 6, 2), " ", substring(my:DATE[../my:SIG_BOX = string(false())], 1, 4), "
    ")'), ".."

    Where the value is False I then get the Dates listed as below:

    19/12/2014

    20/12/2014

    21/12/2014

    If one of the values for the SIG_BOX then changes to True it then removes the extracted date values but leaves the seperator forward slash. ie. If the SIG_BOX value for the 20/12/2014 changes to True but the others are still False I get:

    19/12/2014

    / / 

    21/12/2014

    Is anyone able to help with where I'm going wrong with this final bit?

    Many thanks.

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