Remove choice from the drop-down - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Remove choice from the drop-down

Last post 11-01-2018 01:42 PM by Anomadeus. 14 replies.
Page 1 of 1 (15 items)
Sort Posts: Previous Next
  • 10-09-2018 07:49 AM

    Remove choice from the drop-down

    Hello! I have visited here more than a few times and I have always found the best answers. I have recently come up to an issue I wasn’t able to resolve.

    I have a form that a user can select values in 4 repeating tables (values are called in from a SharePoint lists)

    Once the user selects their selections in view 1, approvers must make approvals on the selections that were made in view 2.

    The approvers view has drop downs that are filtered and only displays the what the user selected from one (or all) of the first 4 fields. The approver selects their choice, selects approve and clicks the update button. After they push the update button, what they had selected and their approval selection are listed in the appropriate approve or rejected text fields.

    The issue I’m having here is: How do I stop the approver from selecting the same choice twice?

    Essentially, how do I remove the choice from the drop-down list after the approver approves or rejects it? I was attempting to find a way to uncheck the selection that the first user made. But I can only seem to specify the field who has the matching value and it blanks the whole field or sets all values to false.

    Questions that might come up:

    This form has 4 SP lists (150-200 items ea.) of data that the user can select.

    Rules have been setup to not allow more than one selection at a time.

    Any ideas? Please & thanks!

    I'm always trying to learn.
  • 10-12-2018 08:14 AM In reply to

    Any chance you can attach your template under the options tab in a reply? I usually understand questions better when I see the form.... If you are just looking to hide options in a dropdown if they have been previously selected (like in a dropdown in a repeating table) I'm attaching a sample - you can save the file locally & right click to preview.
    Hilary Stoupa

  • 10-12-2018 08:46 AM In reply to

    Re: Remove choice from the drop-down

     Thank you for your reply! I can sum this up better now with some changes that I have made.

    What I need to do is get the selected values from 4 repeating tables (each different lists) and display them in a drop down list that will also be filtered by what has been selected. I hope I'm making sense.. here you are. Thank you for looking! :)

    I'm always trying to learn.
  • 10-12-2018 09:12 AM In reply to

    Re: Remove choice from the drop-down

    What field(s) have the values that you want to display the selection of in another dropdown? This may not be possible - if it is a single field that allows multiple selections, that can probably be done - but this is a list form and we can't use code, and we can't select non-repeating main data source fields as the source values for a dropdown.
    Hilary Stoupa

  • 10-12-2018 10:24 AM In reply to

    Re: Remove choice from the drop-down

     The fields are:

    • Request Type
    • Mailbox
    • SAS_Database
    • Sharepoint_site

     

     

     

     

    I'm always trying to learn.
  • 10-12-2018 11:28 AM In reply to

    Re: Remove choice from the drop-down

    So - you could use any one of those fields as a data source for a dropdown (see attached screenshot) but you can't combine them. It sounds like you want to combine them (just the selected values) - but that can't be done out of the box. It would take code - and list forms don't support code. It may be possible to modify the XSL for the view file, but I've not tried it and browser forms can be more particular about those sorts of modifications than filler forms.
    Hilary Stoupa

  • 10-12-2018 11:41 AM In reply to

    Re: Remove choice from the drop-down

    Thanks again for looking at this! I have already had 4 filtered drop downs for each to only display the selected values... but I wasn't able to do any further filtering. for instance i couldn't filter the selected choices from the already filtered 4 fields. It would be needed to not allow the same selection twice... any idea how that's done? Please & Thanks!

    I'm always trying to learn.
  • 10-12-2018 12:01 PM In reply to

    Re: Remove choice from the drop-down

    You looked at my sample form? It doesn't allow the selection of the same item twice.
    Hilary Stoupa

  • 10-15-2018 08:59 AM In reply to

    Re: Remove choice from the drop-down

     Thank you for your example. I have seen this script else where on the web. It never seems to work properly when implemented.

     I have attempted:

     not(. = xdXDocument:get-DOM()/my:myFields/my:dataFields/my:SharePointListItem/my:SAWChoice)

    This displays nothing in the drop down list. After reviewing the field I thought the issue might be in the string. so I tried:

    not(. = xdXDocument:get-DOM()/my:myFields/dataFields/my:SharePointListItem/my:SAWChoice) 

    No changes... Any ideas? Please & Thanks


     

    I'm always trying to learn.
  • 10-16-2018 04:06 PM In reply to

    Re: Remove choice from the drop-down

    What view is this dropdown in? Sorry, I'm having a hard time finding things in your form. The XPath to SAWChoice is incorrect in your sample above - I'd guess not(. = xdXDocument:get-DOM()/dfs:myFields/dfs:dataFields/my:SharePointListItem_RW/my:field10) would be the right XPath.
    Hilary Stoupa

  • 10-17-2018 07:54 AM In reply to

    Re: Remove choice from the drop-down

    Thank you for your reply. Good to know that its trying to get the true field name and not what InfoPath shows. That doesn't seem to be working either... However, I think the issue is in my communication.

    The four drop down fields would need to be filtered by the submitted selection. I have created a field ( SAW_Choice_Collect) that collects the submitted values. (The selections that have been approved or rejected) separated by a ";"  at this point I would need to filter out choices that are not in listed in SAW_Choice_Collect. I have been trying to use "does not contain" or "contains" the results are all or nothing..

    I attempted SAW_Choice_Collect contains RequestType (Value) or RequestType (Value) contains SAW_Choice_Collect.

    I also attempted, SAW_Choice_Collect does not contain RequestType (Value) or RequestType (Value) does not contain SAW_Choice_Collect.

    I'm not sure how its retrieving the values to create the comparison... Thanks again for any help you can provide...


    I'm always trying to learn.
  • 10-17-2018 08:36 AM In reply to

    Re: Remove choice from the drop-down

    Thank you for all your help! Oddly, enough. SAW_Choice_Collect does not contain RequestType (Value) has started working!

    I'm always trying to learn.
  • 11-01-2018 07:42 AM In reply to

    Re: Remove choice from the drop-down

     Hello again,

     I found that I am unable to use my solution and I'm forced to go back with filtering.

    The Expression below does nothing to filter the repeating table drop down selections. Does anyone have any idea why?

     not(. = xdXDocument:get-DOM()/dfs:myFields/dfs:dataFields/my:SharePointListItem_RW/my:group5) 

    Please & thanks

     

     

    I'm always trying to learn.
  • 11-01-2018 12:52 PM In reply to

    Re: Remove choice from the drop-down

    Groups don't generally have a value? Is there a field inside group5 you should be comparing to?
    Hilary Stoupa

  • 11-01-2018 01:42 PM In reply to

    Re: Remove choice from the drop-down

     The only field listed in the group is Value. From this question, I gather you mean that the expression should contain "Value"

    I have already attempted the following:

    not(. = xdXDocument:get-DOM()/dfs:myFields/dfs:dataFields/my:SharePointListItem_RW/my:group5/my:Value) (does nothing)

    Also,

    not(. = xdXDocument:get-DOM()/dfs:myFields/dfs:dataFields/my:SharePointListItem_RW/my:group5/my:Value = @d:title) (shows no selections)

    any ideas?

     

    I'm always trying to learn.
Page 1 of 1 (15 items)
Copyright © 2003-2018 Qdabra Software. All rights reserved.
View our Terms of Use.