Skip to main content

Search

Exclude option from Choice Column in New Item based on SharePoint Permission Groups

Comments

8 comments

  • skybow Support

    Hi Maria

    Choice Columns doesn't have any built-in filter possibilities in Modern Forms.

    I would suggest to maintain your Status values in a separate list and reference it by a lookup column.
    This gives you the possibility of filtering on related forms:
    After creating a new list with all the status values and setting a lookup on the list with forms in question:
    1. Open the Field configuration of the new lookup field

    2. Create a new filter
    3. Add this condition to only apply the filter if the user is not part of the Owners group:

     =![[@User.IsMemberOfGroup('Owners')]]

    4. Get the status values which should be shown and selectable for everybody

    Hope this helps - please let us know.

    0
  • Maria Giugno

    Hello Skybow support,

    This solution is not working. When I add the values and test the dropdown is empty. There is no way to use the column I already have on the form and use a javascript function to achieve this? The status column has been in use for quite some time and I will have to bring all of the status values from all of the older submissions if I move ahead with this suggestion. Thank you for your time.

    0
  • Maria Giugno

    I just tested this with another user and the drop-down values are not displaying with this filter. I appreciate your assistance with this request. 

    0
  • Maria Giugno

    Does the Rule/Condition need to be an assignment or Template. I cannot get it to work how you have it in the screenshot. thank you for your assistance 

    0
  • skybow Support

    Hi Maria
    My mistake... Needs to be an Assignment Expression in the Rule/Condition (starting with an = character). Just changed in the answer above.

    1
  • Christof

    Hi Maria
    There is an approach by adding some custom code + css to hide the specific options in the dropdown on form load.

    1) 2) Create a new Execute script action in the Form Load Actions (Pre-Form Load):

    3) Add this code to the Execute script Action:

    $('head').append(`<style type="text/css">
    div.sb-dropdown-option[title="On Hold"],
    div.sb-dropdown-option[title="Cancelled"],
    div.sb-dropdown-option[title="Archived"] {
       display: none;
    }
    </style>`);

    Replace the option names in the script above with your own values.

    4) Use the following Expression as Condition for the Action (Assignment):

    ![[@User.IsMemberOfGroup('Owners')]]

     

    Hope this works for you. Please let me know!

    2
  • Maria Giugno

    This worked! Thank you very much for the solution Christof!

    0

Please sign in to leave a comment.