+ Start a Discussion
Kris Hankins 25Kris Hankins 25 

Displaying address fields in Lightning component

I have a custom object that I am creating a custom Lightning component for in order to display specific information based on the client's needs. I need to pull the Account Billing and Shipping addresses in to display them using this Lightning component but none of the address fields are able to display. I have tried using the <lightning:formattedAddress> component to display them but it seems that you can only hard code the values into this component as attributes and not pull in data field values? Has anyone had success in displaying (VIEW ONLY) address fields in a custom component? 
Ramesh DepaiahRamesh Depaiah
@kris,
I tried below code and it works fine, fetch address from contact and display it in <lightning:formattedAddress>. Please try and let me know if it works
https://sfdevcom.com/2019/06/salesforce-lightning-formattedaddress

Thanks
Ramesh
Kris Hankins 25Kris Hankins 25
Thanks for the response, Ramesh. I am utilizing the force:hasrecordId and force:recordData classes so I shouldn't need to create a custom controller to access the fields since I'm setting the targetFields attribute on <force:recordData> to "{!v.InvoiceRecord"}. I am able to reference the Account object fields for other values in this component fine. It's only the address fields that aren't displaying.