web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Global Choice Field : ...
Power Apps
Unanswered

Global Choice Field : - What is this Hidden checkbox?

(0) ShareShare
ReportReport
Posted on by 26
Hi,
 
I have created a global choice field and added few values in there. I noticed that there is a "hidden" checkbox when I navigate to additional properties thinking that it would hide that particular value from the UI. But this value is not hidden in the model driven app UI and I can still see the "Not in use" value there. 
 
I have published the entire solution and the choice field but no luck. Can anyone tell what is the usage of this hidden checkbox against a value?
 
Also, I don't want to delete the option value as this will remove the legacy values as well from the records.
 
 
 
 
Thanks,
Nitin
Categories:
I have the same question (0)
  • Ravindra Jadhav Profile Picture
    342 Moderator on at
    if you can unhide that and then removed it, then it will not display in model driven app
     
     
    Please Closed the Question, Mark it Solved 
     
    If my answer helped resolve your issue, please consider marking it as solved to assist others facing the same problem. Additionally, giving it a like would be greatly appreciated and motivates us to keep helping
     
    Thank You
    Ravindra Jadhav
  • nitingupta4u Profile Picture
    26 on at
    Hi Ravindra,
     
    I don't want to delete the option as this will remove the legacy values as well from the records.
     
    Nitin
  • satya_vijay_2025 Profile Picture
    76 on at
    @nitingupta4u

    I m not sure why the hide Option is not working out of Box.

    However you could do the same with JS. 

    STEP 1 :Create JS file in the local machine 
     
    function removeOptionFromGlobalOptionSet(executionContext) {
        var formContext = executionContext.getFormContext();
        var fieldName = "cr682_choose";
        var optionToRemoveValue = "Test3";
        var fieldControl = formContext.getControl(fieldName);
        var field = formContext.getAttribute(fieldName);
        
        if (field) {
            var options = field.getOptions();
            var option = options.find(opt => opt.text === optionToRemoveValue);
            
            if (option) {
                fieldControl.removeOption(option.value);
            }
        }
    }
    

    Code explanation 
    • Identify Field and Option: Defines the field's logical name and the option value ("Test3") to remove.
    • Find the Option: Retrieves the options of the field and searches for the option with a matching text.
    • Remove Option: If the option is found, it removes it from the option set using removeOption.

    STEP 2:  Add the JS to Web Resource 
    • Navigate to Solutions 
    • Click New > Web Resource.
    • Name it (e.g., removeOptionWebResource), select JavaScript as the type, and upload your .js file.
    • Save and publish the web resource.
       
    STEP 3 : Add to the intended Form
    • Navigate to the intended table
    • Open the Forms section for that Table
    • Select the form you want to modify.
    • Under the Form Libraries section, click Add.
    • Select the JavaScript Web Resource (e.g., removeOptionWebResource).
    • Click Add to attach the web resource to the form.
     
    STEP 4:  Add the JS to Onload 
    • In the Form Properties, go to the Event Handlers tab.
    • Under Form Libraries, select the added JavaScript web resource.
    • In the Event section, choose OnLoad.
    • In the Function Name field, enter removeOptionFromGlobalOptionSet.
    • Ensure the Enabled checkbox is selected.
    • Click OK and then Save and Publish the form.


    OUTPUT : 



    If you would like to remove more than 1 options 
    function removeOptionFromGlobalOptionSet(executionContext) {
        var formContext = executionContext.getFormContext();
        var fieldName = "cr682_choose";
        var optionsToRemove = ["Test3", "Test4", "Test5"];  // Array of options to remove
        var fieldControl = formContext.getControl(fieldName);
        var field = formContext.getAttribute(fieldName);
    
        if (field) {
            var options = field.getOptions();
            
            // Loop through each option to remove
            optionsToRemove.forEach(function(optionToRemoveValue) {
                var option = options.find(opt => opt.text === optionToRemoveValue);
                
                if (option) {
                    fieldControl.removeOption(option.value);
                }
            });
        }
    }
    

     
    ​​​​​​​ Sathyamoorthy Vijayakumar | LinkedIn
  • nitingupta4u Profile Picture
    26 on at
     
    I understand that we can hide the values with a JavaScript function, but I just want to understand what the usage of this hidden checkbox against the value in choice field.
     
    Thanks,
    Nitin
  • Suggested answer
    LindsayGG Profile Picture
    2 on at
    Hi Nitin,
     
    Like you I hoped this new "Hidden" property would save me some JScript, but that is not the intention.  Saw this thread on LinkedIn a few days ago (https://www.linkedin.com/posts/maheshghori_dynamics365-dataverse-configuration-activity-7305710594077118465-onzr) and it included this nice explanation:
     
     
     
    All that said, this appears to work for form-level hiding in this excellent video: https://www.youtube.com/watch?v=I_MrwoDNFHE but I didn't (yet) have any success getting this to work in my own environment.
     
    Hope it helps,
    Lindsay.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard