How to display custom object Records in Lightning?

How to display custom object Records in Lightning?

I want to display records from custom object based on SOQL query from Apex class. I have referred to this Article which explains how to do that. However I am not able to display records on the component.

How to display list of contacts in Lightning?

Now to accomplish the task of displaying a list of contacts we need to first analyse that how we can decompose this request into small components. i.e. a list of record will have detail of a single record in each line. Therefore each line of record can be an individual component and can be repeated and iterated over till the end of records.

How to display a read only record in Lightning aura?

To display a read-only record with a custom layout, use the lightning:recordViewForm component. To compose a form field, use lightning:outputField components, which maps to a Salesforce field by using the fieldName attribute.

How to output data from a lightning component?

You are very close to what you are trying to achieve, you need to output that data, You loaded it correctly just forgot to add the controller in the component as already suggested by @glls and then output the data inside the aura:iteration like this: You need to invoke the controller in your lightning component, you can refer to the documentation

How to show child components in Lightning web component?

This code will show the child component only if there is a value in the field. Use lightning-record-edit-form/lightning-record-view-form so the fields don’t render by default, and you have freedom to show/hide the fields. You dont need to use the lightning-output-field with lightning-record-form, record-form will automatically do it for you.

How to compose a form field in Lightning?

To compose a form field, use lightning:outputField components, which maps to a Salesforce field by using the fieldName attribute. Including individual fields lets you style a custom layout using the Lightning Design System utility classes, such as the grid system.