I would strongly recommend Alexandre Dube's excellent layertreeBuilder ux which includes this functionality. Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.