0

Is there a way, while iterating through a List of field names to retrieve the corresponding record field value? Ex:

<aura:attribute name="layoutAPIFieldsList"  type="List" />

<aura:iteration items="{!v.layoutAPIFieldsList}" var="e">
    // e = each Apex returned field name for Case object
    <span class="test-id__field-label slds-form-element__label">{!e} &nbsp; 
    </span>
    <span id="underline" class="test-id__field-label slds-form-element__label"> 
        // Trying to get the value of the field through LDS
        // vvv Code in question vvv
        {!v.simpleRecord} + '.' + {!e}
        // ^^^ Code in question ^^^
    </span>
</aura:iteration>
  • yes, however, what is it that you are querying server side? what does your r esponse look like? if your list resembles someting like [{'fieldname':'xxx', 'fieldVal':'xxxx'.....}] the shouldnt be any reason why you cant – glls May 29 '18 at 16:26
  • 1
    There is no support in the expression language to get a field value from a record using a field name as a key. (Unlike in Visualforce.) – Keith C May 29 '18 at 16:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.