I'm struggling trying to figure out how to iterate over an array of objects returned by an Apex method to print object name + label as key.
The structure of the object is the following:
public class SalesforceObject {
public String name;
public String label;
}
JS Controller is the following:
import { LightningElement, wire } from 'lwc';
import getSObjectList from '@salesforce/apex/ReportsAppController.getSObjectList';
export default class SObjectList extends LightningElement {
@wire(getSObjectList) objectList;
}
And my template is the following one:
<template>
<template if:true={objectList.data}>
<template for:each={objectList.data} for:item="object">
<p key={object.Label}>{object.Name}</p>
</template>
</template>
</template>
Already tried to capitalize and lower-case Label & Name words, but still is not working...