[SalesForce] Dynamically display fields in lightning component

Based on the value choosen in a flow, i need to dynamically display fields in the lightning component in the next screen. The fields may be just text/number fields to capture data and is not a field in any object. We need to have a lightning component to be called from a flow since there are other sections to be displayed which will not change.

Could you please let us know of any options for the dynamic display

Best Answer

You could set a list of fields in a list variable and loop over the list to display lightning component according to field type / name.

Example :

<aura:iteration items="{!v.fieldNames}" var="fieldName">
<c:childcomponent  fieldName="{!fieldName}" />
</aura:iteration>