Infopath | Multiple Selection List Box - link to list + rules on selection - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Infopath | Multiple Selection List Box - link to list + rules on selection

Last post 04-01-2022 08:22 AM by Hilary Stoupa. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 03-14-2022 02:13 AM

    Infopath | Multiple Selection List Box - link to list + rules on selection

    Hi everyone I have been working on a project and keep getting stumped with the outcome I want to achieve. I am fairly new to SharePoint/Infopath and hoping I can get pointed in the right direction, or confirmed what I am trying to achieve is not possible (hopefully the former). I know there are a few posts on here about multiple selection list boxes and through my digging I have found some great info which has definitely helped, but this is my problem... The idea I am trying to achieve is essentially very simple; I have an external list (located on SP) which contains 3 columns - COUNTRY, SURF BREAK and STATUS (see attached file), my form has one drop down selector box for the COUNTRY field and a multiple selection list box for the SURF BREAK field... connecting them and filtering the available SURF BREAK options by the COUNTRY drop down box is all good, I'm fine with that (thanks to help on this forum). My issue comes when I want to pull the STATUS field from the external list depending on the options chosen in the multiple selection list box. For e.g. if we look at the external list and focus on Australia; it has three breaks and one of them has a red status, other two are green.... if a user chooses Australia in the first drop down, and then selects two SURF BREAK options (one red and one green), I want a text field to show the STATUS field of the chosen SURF BREAK, but if any items with a red STATUS are selected then it should override any green status'. Hopefully that makes sense but let me know if you need clarification. So what I want to do is pull through the STATUS field based on the set of chosen items selected in the multiple selection list box. I know that I can trigger actions when a user selects an item in the multiple selection list box, and also when they deselect one, but I cant think of any way to automatically pull the STATUS field & override any green STATUS if there are red ones. I have looked at this post which helped me quite a bit (https://www.infopathdev.com/forums/p/17850/62269.aspx) but I am still stuck coming up with a way to avoid any hard-coded rules etc. to determine if the overall STATUS is red - I need to be able to have the external list get updated from time to time by other parties and therefore avoid the work of hard-coding more options etc. down the line. I am using SharePoint 2010 / Infopath 2013 & any help or ideas would be very appreciated. Thank you :)
  • 03-14-2022 03:22 PM In reply to

    Re: Infopath | Multiple Selection List Box - link to list + rules on selection

    So, the biggest issue I see is that multiple selection list boxes can be kind of flaky - the rules that should run when selected / deselected don't always seem to run correctly, and defaults don't always seem to calculate correctly (i.e., sometimes you have to deselect an item to get the default to calculate). What about having a button for this? See attached - right click the sample form in the header and save locally. Right click the locally saved file and select Design and then preview. The data sample only has one country in it - just wanted to work up a quick POC for you :)
    Hilary Stoupa

  • 03-15-2022 01:38 AM In reply to

    Re: Infopath | Multiple Selection List Box - link to list + rules on selection

    Hi Hilary! Thanks for the reply and POC form - I am not sure why I didn't think if having a button check the status and update it! Yes, those multiple selection lists are quite tricky indeed! I am thinking now that when the user submits the form (via a button) I trigger that action to check and update the status, which it will hopefully update just before saving. I noticed that when one of the 'red' surf breaks was de-selected (with other green ones still selected) the check button didn't update it back to green? Something I am missing perhaps? I have had a look at the expression you used and am completely lost haha, but I will try to decipher it and get an understanding - I dont know how you connected it to select the corresponding status field from the external list.. I know how to filter selections based on the external list but stumped on how to do this through actions attached in rules (the expression *kind* of makes sense) . Anyway, appreciate your thoughts & time on this, I will continue to look at it and get my head around it :)
  • 03-15-2022 05:04 AM In reply to

    Re: Infopath | Multiple Selection List Box - link to list + rules on selection

    Ok, so I have managed to get it working with an action off the multiple selection list box, when a value changes and have a backup of a button - thank you Hilary. I used this formula: eval(eval(XXX, 'concat(., "; ")'), "..") and in XXX I selected the status field from the secondary list I have (showing RED/GREEN etc.) and applied a filter where the Country (secondary list) = country field (on the form) and the Surf Break (secondary list) = Value (which is the value of the multiple selection list box on my form *selecting the underlying value, not the group*). It now updates a text field with a list of status' and I can match off that and trigger some other actions! :D
  • 03-15-2022 07:34 AM In reply to

    Re: Infopath | Multiple Selection List Box - link to list + rules on selection

    Great job, glad you have it working!
    Hilary Stoupa

  • 04-01-2022 02:10 AM In reply to

    Re: Infopath | Multiple Selection List Box - link to list + rules on selection

    Hey Hilary, cant see that I replied but thank you for the assistance on this one :)
  • 04-01-2022 02:37 AM In reply to

    Re: Infopath | Multiple Selection List Box - link to list + rules on selection

    I now seem to be having an issue with the form saving the data in a text box which gets populated when the entry is created - let me explain further; so I have the form working correctly and updating the STATUS field based on the selection of the previous fields (COUNTRY and SURF BREAK) - this is done by a rule (setting the value of the STATUS field). However when I create an entry, save it and then open it again via the edit link (to the item), that STATUS field is blank... along with the 'helper' fields I created to identify the overall status (those helper fields' rules are based on 'when a value changes' so that might be why its not updating). I have tried to edit the properties of that STATUS field (and the helper fields - which save in the list when the form saves) to set the postback settings to 'Always' but that doesn't seem to help. Im kind of confused as to why I can see there is data in the helper fields (when viewing the list on SharePoint) but they are not populated when I edit the item?? Any ideas as to why and how this is happening?
  • 04-01-2022 08:22 AM In reply to

    Re: Infopath | Multiple Selection List Box - link to list + rules on selection

    May I see your form? You can attach it under the Options tab in a reply.
    Hilary Stoupa

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