Double eval, concat formula does not keep comma separator - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Double eval, concat formula does not keep comma separator

Last post 03-19-2015 12:53 AM by posvse. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 06-19-2014 11:23 PM

    Double eval, concat formula does not keep comma separator

    Hi guys,

    I am using a double eval / concat rule on a multi-select listbox in order to populate a text field with those selections.  My problem is that when I test the formula the comma moves to the end of the each new selection made.  (i.e. instead of displaying Apple, Lemon, Banana it displays AppleLemonBanana, )

    Formula being used:  eval(eval(ProgramDepartmentSelect, 'concat(., ", ")'), "..")                (Note - ProgramDepartmentSelect is the group of my multi-select and the . is my value field)

    Also, this formula does not remove selected items if unticked.  This has been driving me crazy for days now!

     

    Thanks guys, T 

    Filed under: ,
  • 06-22-2014 07:17 PM In reply to

    Re: Double eval, concat formula does not keep comma separator

    Hi Tim,

    I don't know if the double eval concat can be done without a repeating group. That's the only way I've seen it implemented.

    So you could change from a listbox  to a repeating group with a dropdown inside it. Not too different and works in my attached sample.

    Good luck!

    Patrick Halstead
    Project Manager at Qdabra
  • 06-22-2014 09:28 PM In reply to

    Re: Double eval, concat formula does not keep comma separator

    Hi Patrick,

    I should have mentioned, this is a SharePoint form, and when I customize the form in Infopath I do not have a Repeating Group option under the Controls section.

     

  • 06-22-2014 11:44 PM In reply to

    Re: Double eval, concat formula does not keep comma separator

    When you say ProgramDepartmentSelect is the "group" of your multi-select, does that mean it's an acual group (shown as a folder icon in the data source taskpane) or is it the actual field (shown as a sheet of paper in the taskpane)? The latter is what you should be using in your formula.

    As far as getting the formula to recalculate when items are unchecked, you need to use a default value formula on the target field (where the combined value will go) and use this formula there as well. The default value formula will execute when items are deselected, and rules will act when items are selected.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 06-22-2014 11:59 PM In reply to

    Re: Double eval, concat formula does not keep comma separator

     ProgramDepartmentSelect is the folder icon as you mentioned.  If I change that part of the formula to the actual list (sheet of paper as you mentioned), then when testing, my text field only displays the most recently checked item.

    Re the unchecked part - at this stage I need the first part working, but I will keep your help in mind. 

    Thanks 

  • 06-23-2014 02:56 AM In reply to

    Re: Double eval, concat formula does not keep comma separator

     Since the rule is executing in the context of the repeating field, you need to go up the node tree and back down in order for the formula to capture all of them. Like this:

    eval(eval(../SheetOfPaper, 'concat(., ", ")'), "..")               

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 06-23-2014 04:31 PM In reply to

    Re: Double eval, concat formula does not keep comma separator

    Jimmy,

    If I change my formula to your suggestion, in testing, it only displays the most recently selected item from the multi-select listbox.

  • 03-19-2015 12:53 AM In reply to

    • posvse
    • Not Ranked
    • Joined on 03-19-2015
    • Posts 1

    Re: Double eval, concat formula does not keep comma separator

    I have the same problem. The delimiter token is only applied at the end of the list. Was there any solution to this?
Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.