0

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

1 Answer 1

1

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>
3
  • These are actually input boxes which can be text , number , date etc. We will not know the datatype as well. and the number of fields to display also varies with the value chosen in the flow that calls the lightning component Commented Jun 24, 2019 at 9:43
  • Inside the child component, you can check for the data type : Example : <aura:if type='Integer'> // integer component </auraif> <aura:if type='Text'> // text component </auraif> Commented Jun 24, 2019 at 9:44
  • Number of fields won't be an issue with this approach, you just have to make sure that all field types are handled in your child component. Commented Jun 24, 2019 at 9:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .