Activity Forums Salesforce® Discussions Difference Between Component.get() And Component.find() in Salesforce Lightning

  • Difference Between Component.get() And Component.find() in Salesforce Lightning

    Posted by Ayush on July 17, 2020 at 12:18 pm

    Difference Between Component.get() And Component.find() in Salesforce Lightning

    Pooja replied 4 years, 4 months ago 4 Members · 3 Replies
  • 3 Replies
  • Kirandeep

    Member
    July 17, 2020 at 12:27 pm

    get() method to access the data from respective component(UI). The find() function has one parameter, which is the local ID of a component within the markup. find() returns different types depending on the result. If the local ID is unique, find() returns the component

  • Shweta

    Member
    July 17, 2020 at 1:26 pm

    Component.get(): It returns the Aura.Component instance(s) by its local ID. If the Aura.Component local ID is unique, it returns the component, and if there are multiple Aura.Component with the same local ID, it returns an array of the components.Component.find(): It is associated with Component attributes and returns the referenced component attribute value.

  • Pooja

    Member
    July 17, 2020 at 5:21 pm

    Component.get(): It returns the Aura.Component instance(s) by its local ID. If the Aura.Component local ID is unique, it returns the component, and if there are multiple Aura.Component with the same local ID, it returns an array of the components.Component.find(): It is associated with Component attributes and returns the referenced component attribute value.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos