Introduction
In this post, we will learn to build a Dynamic Lightning CheckBoxGroup in the Salesforce lightning
platform. Using the lightning checkbox group, we will display multiple values with checkboxes. We will learn this concept in just three simple steps.
Step 1
Create a Lightning component from the developer console and save it.
Step 2
Here is the code for the component which displays the checkbox group:
- <aura:component implements="force:lightningQuickActionWithoutHeader,force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes"
- access="global" controller="CheckBoxGroupController" >
- <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
- <aura:attribute name="options" type="List"/>
- <aura:attribute name="selectedVal" type="List"/>
- <div class="slds-box slds-theme_default">
- <lightning:checkboxGroup name="Checkbox Group"
- label="Checkbox Group"
- options="{! v.options }"
- value="{! v.selectedVal }"
- onchange="{! c.handleChange }"/>
- </div>
- </aura:component>
Step 2
Now add controller.js and write the below code which will get record details:


Join the conversation! Your thoughts help the community grow.