Activity › Forums › Salesforce® Discussions › How to remove an element placed at an index from an array in Salesforce? Tagged: Array in Salesforce, Data Elements, Developer Console, Elements, Method Salesforce® Discussions How to remove an element placed at an index from an array in Salesforce? Posted by Yogesh on November 20, 2019 at 6:38 AM i have to remove an element placed at an index from an array? Prachi replied 6 years, 5 months ago 2 Members · 1 Reply Array in SalesforceData ElementsDeveloper ConsoleElementsMethod 1 Reply Prachi Member November 20, 2019 at 6:44 AM Hi, Find the index of the array element you want to remove, and then remove that index with splice. The splice() method changes the contents of an array by removing existing elements and/or adding new elements. var array = [2, 5, 9]; console.log(array) var index = array.indexOf(5); if (index > -1) { array.splice(index, 1); } // array = [2, 9] console.log(array); Thanks. Log In to reply. Public All Members My Connections Only Me PublicAll MembersMy ConnectionsOnly Me Public All Members My Connections Only Me