+ Start a Discussion

display records from a custom object after adding them by clicking a "Add" button in Lightning

Hi ,
I have a input text field to type in a input value and a custom button "Add" to add these records to a custom object.  After adding the record the record should be displayed immediately on the same page.
If I add 5 records all the 5 records should be displayed after the Add button.  If I add a 6th record now this record should be visible after the 5th record.

How to accomplish this?


1. create a Attribute of List of sobject

2. yo can use force:createRecord event to create record and once the record is saved add it to list at #1 
3. Display the list at #1 whereevr you want the list of records to be show.
4. user auraIteration to display records in the list

Ashif KhanAshif Khan
Hi Rao,

this is the trailhead expense list module which works similar to your requirement 

I hope this will help you