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

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>
  • 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 – SFDC Learner Jun 24 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> – Ajinkya Phadnis Jun 24 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. – Ajinkya Phadnis Jun 24 at 9:47

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.