Search: Address Formatter on Cards for non-location/location-like entities

Hi team,

Looking for some support in updating the way that Addresses are formatted on cards in my Careers vertical. I have the experience set up with override cards to pull in the address, as the Jobs entity type does not have address stored in its standard schema; however, I’m running into an issue with the way that the data is formatted and displayed on the front end. It looks like for location and location-like entities/card types, we have standard styling built in to display the data in the following manner:

  • Address Line 1 + Address Line 2
  • City, State, Zip
  • Country

However, when using the same Formatter.address(profile) formatter in the component.js file for my Careers Override card, I see all data displayed on a single line on the card, instead of formatted in the standard way I’d expect it to be stored.

Is there any way for me to use the standard Address formatter on non-location/location-like entity cards, and see the same display pattern as seen on location entities?

Thanks in advance!

Sunil

Hi Sunil,

So the reason this is occurring is because of how the data is coming through liveAPI. In location entities, each address section has its own field:

whereas in the Jobs entity, it’s coming through as one string so the formatter doesn’t know how you want to parse the data.

Is there a consistent way you would want to break up this above location string (e.g., comma separated)?

Are all of the job entities tied to a location entity? I ask because another idea would be to leverage streams to multi-hop and bring in the address field from the location entity.

Alyssa