Form load rules to set and appended multiple values in MSLB - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Form load rules to set and appended multiple values in MSLB

Last post 02-07-2020 11:24 AM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-07-2020 09:12 AM

    Form load rules to set and appended multiple values in MSLB

    This if for InfoPath 2013. Came across a previous thread for writing values from a MLSB to another control which was very helpful for understanding the double eval formula.

    I am attempting to do something similar, but append the selection values within the MSLB control. Currently, I have 5 conditional form load rules which trigger and set a corresponding value in the MLSB. Given the logical nature of InfoPath rules, the 5 form load rules overwrite previously triggered values instead of appending them.

    My initial thoughts were the double eval trick was the right direction, but instead of concatenating values as text into 1 value, I need them to be set as separate values within the MLSB.

    Here's what I have so far in my formula: eval(eval(changeManagementImpacts_mch, 'concat(., ", Translations to be updated or created (French or Spanish)")'), "..")

    ", Translations to be updated..." is concatenated as text to my control's default value ("None Selected"), where instead I would like them to be set as separately selected values.

    Anyone successfully done this before? Any help is greatly appreciated!


  • 02-07-2020 09:18 AM In reply to

    Re: Form load rules to set and appended multiple values in MSLB

    Ooooh, I'm confused. Can you attach a copy of your form under the Options tab in a reply? One thing - if you need to work around the five condition limit, change the first dropdown for your condition to "the expression" and you can copy out the actual XPath to the condition and add the "and" or "or" as appropriate in a single large expression. https://www.infopathdev.com/forums/t/14871.aspx
    Hilary Stoupa

  • 02-07-2020 09:48 AM In reply to

    Re: Form load rules to set and appended multiple values in MSLB

    Hello Hillary! I've attached a copy of my form. The control in question (changeMangementImpacts_mch) is at the bottom of view 2.11. The form load rules I have are the very last rules under Form Load. This is for an SPO List, just FYI.

    Essentially, these form load rules are checking if columns in a separate list are marked for a specific item. If yes, I want the corresponding value(s) in my MLSB to be pre-selected on form load. The problem I am running into is due to the logical nature my form load rules overwrite the previously triggered values which results in only 1 selected value, instead of keeping the previously triggered values selected.

  • 02-07-2020 11:24 AM In reply to

    Re: Form load rules to set and appended multiple values in MSLB

    Ah-hah, now I understand! The issue is actually due to the nature of a multi-select list box, unfortunately. So - you'll see that the Value field is repeating if you look at the schema in advanced view. Unfortunately, when we select and deselect options in a multi-select, behind the scenes, InfoPath is inserting and deleting instances of this repeating node. However - since there is no rule-based way to add or delete repeating node instances, and there is no rule based way to index the target node, you end up in a situation like this. By default, your form will only have one Value node, but even if you re-opened a form where multiples have been selected (so there are multiple instances of the Value node) you still don't have a way in the field picker for the target node to specify which instance you wish to set - InfoPath will always just overwrite the first one.
    Hilary Stoupa

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