writing values from a multiple-selection list box to another control - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

writing values from a multiple-selection list box to another control

Last post 07-12-2019 08:58 AM by Hilary Stoupa. 72 replies.
Page 5 of 5 (73 items) < Previous 1 2 3 4 5
Sort Posts: Previous Next
  • 07-03-2019 11:59 AM In reply to

    Re: writing values from a multiple-selection list box to another control

     I know this is an old post but since it is related to my challenge I thought I'd add to it.  I can get multiple selections concatenated into another field (textbox).  My challenge is that I want each selection concatenated with a date value and then concatenated into a text box.  Does anyone have a solution for that?

     

    Thanks, 

    Filed under:
  • 07-03-2019 12:15 PM In reply to

    Re: writing values from a multiple-selection list box to another control

    Probably. :) Where is the date value? Can you attach your form (or a sample) and I can give you a hand.... Under the Options tab in a reply.
    Hilary Stoupa

  • 07-03-2019 12:56 PM In reply to

    Re: writing values from a multiple-selection list box to another control

    Okay, I've attached what I got so far. I can make multiple days from the list and click on the button Add to List Textbox and that works. I would like to be able to select one or more days from my list, select a date and add them to my list in the format Mon: 2019-07-03, Tue: 2019-07-03, etc. I would then like to be able to change my selections and the date, and add those items to the list.
  • 07-03-2019 01:05 PM In reply to

    Re: writing values from a multiple-selection list box to another control

    See attached.
    Hilary Stoupa

  • 07-03-2019 02:57 PM In reply to

    Re: writing values from a multiple-selection list box to another control

     Thanks Hilary.  That's what I needed.

  • 07-11-2019 01:19 PM In reply to

    • noram
    • Not Ranked
    • Joined on 07-10-2019
    • Posts 4

    Re: writing values from a multiple-selection list box to another control

      Hi - I know this particular message is very old, but my attention was caught by

    "I also did some touchups to prevent extraneous semicolons at the beginning and end of the list."

    My rule is working fine, but I have the annoying commas before and after the items. I do want them separated by commas, but I hate how it looks at the beginning and end. How did you accomplish this or does anyone else know how to "pretty" it up?

     eval(eval(field19, 'concat(., ",  ")'), "..")      is what I have from a multiple selection list into a calculated value control.

    Thanks! 

  • 07-11-2019 01:24 PM In reply to

    Re: writing values from a multiple-selection list box to another control

    You can use a substring formula and swap the comma and the node. substring(eval(eval(field19, 'concat(", ", .)'), "..") , 2) I think will do it.
    Hilary Stoupa

  • 07-11-2019 01:51 PM In reply to

    • noram
    • Not Ranked
    • Joined on 07-10-2019
    • Posts 4

    Re: writing values from a multiple-selection list box to another control

     That removed the comma at the end, but not the one at the beginning. I'm really new to writing these formulas, I keep messing with it I just can't seem to get it.

     

    Much appreciated!! 

  • 07-11-2019 02:03 PM In reply to

    Re: writing values from a multiple-selection list box to another control

    Here's a sample. Save the file locally, right click, select design and preview. Enter rows in the repeating table and add data to the field to see the comma delimited expression below.
    Hilary Stoupa

  • 07-11-2019 02:40 PM In reply to

    • noram
    • Not Ranked
    • Joined on 07-10-2019
    • Posts 4

    Re: writing values from a multiple-selection list box to another control

     I opened what you have, and I have exactly the same formula (except the field obviously). The difference is I'm using a multiple selection list box instead of a repeating table that you enter info into. Do you think this makes a difference? Also my list is coming from a SharePoint List. I am still getting the comma in front of the first item in the list. It shows up as:     , Apples, Oranges, Bananas, Peaches

     

  • 07-11-2019 03:16 PM In reply to

    Re: writing values from a multiple-selection list box to another control

    Yup, multiple section list boxes have a default blank item. You have to add a filter to your field: substring(eval(eval(field19[. != ''], 'concat(", ", .)'), "..") , 2)
    Hilary Stoupa

  • 07-12-2019 08:48 AM In reply to

    • noram
    • Not Ranked
    • Joined on 07-10-2019
    • Posts 4

    Re: writing values from a multiple-selection list box to another control

     I have no idea what that extra stuff means but it worked perfectly. Do you have any recommendations on some kind of guide or how to basics on writing these kinds of formulas?

     

    Thank you! 

  • 07-12-2019 08:58 AM In reply to

    Re: writing values from a multiple-selection list box to another control

    The extra stuff was an XPath filter - basically - "If this field is not blank, I want it" :) I like this site for learning XPath: http://zvon.org/xxl/XPathTutorial/Output/examples.html and I also have a blog post that shows a tip for using InfoPath to help learn XPath: https://www.infopathdev.com/blogs/hilary/archive/2012/05/31/use-infopath-to-teach-yourself-xpath.aspx
    Hilary Stoupa

Page 5 of 5 (73 items) < Previous 1 2 3 4 5
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.