everybody. I have lightning component on which I need to display some fields. Set of fields are dynamic and I`m displaying it using aura:iteration (I have a wrapper with name and label of field, its value and type). But I do not know, which tag use for displaying field, because it may be checkbox or date or anything else. Maybe, somebody already had such problem and can help me to solve this problem. Thank you for help.

closed as unclear what you're asking by Tushar Sharma, Ratan Paul, Sebastian Kessel, Vigneshwaran G, Mark Pond Oct 6 '16 at 23:33

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • you have to create component dynamically based on datatype of the fields.check this answer out it might help you. – Praveen Oct 5 '16 at 17:02

Use force:inputField or force:outputField depending on your need. SF will take care of outputting the correct type

A component that provides a concrete type-specific output component implementation based on the data to which it is bound. Represents a read-only display of a value for a field on a Salesforce object. This component respects the attributes of the associated field and how it should be displayed. For example, if the component contains a date and time value, then the default output value contains the date and time in the user's locale. Bind the field using the value attribute and provide a default value to initialize the object.


  • out of curiosity how did you bind object fields since sobject[dynamicField] syntax does not work? – Kiran Machhewar Oct 11 '16 at 11:42

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