1

I'm trying to implement a standard lwc input address in a custom LWC component. https://developer.salesforce.com/docs/component-library/bundle/lightning-input-address/example.

When I search an Italian address, the province field is not populated when I select an address result. as you can see in the screen below. enter image description hereenter image description here

In the picklist of results search I can see the province code (for example: Roma --> RM). (green box)

enter image description here

Do you have suggestions to work around the problem?

my code:

<lightning-input-address  address-label="Shipping Address"
            street-label="Street"
            city-label="City"
            country-label="Country"
            province-label="Province"
            postal-code-label="PostalCode"
            street=""
            city=""
            country=""
            province=""
            postal-code=""
            required
            onchange={addressInputChange}
            field-level-help="Select Shipping Address"
            show-address-lookup>
         </lightning-input-address>



addressInputChange(event){

    const address = this.template.querySelector('lightning-input-address');

    console.log('Street is ' , event.target.street);
    console.log('City is ' , event.target.city);
    console.log('Province is ' , event.target.province);
    console.log('Country is ' , event.target.country);
    console.log('postal Code is ' , event.target.postalCode);


    }
5
  • the actual issue is not clear, the record does not seem to have a province set, how/where are you setting it? is the form custom? ootb ? missing a lot of details to be able to help you.
    – glls
    Sep 21, 2021 at 14:38
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Sep 21, 2021 at 14:38
  • 1
    Thank you for your helping and sorry if I didn't explain well the issue. So, I need to create a custom input address using google api, in the LWC library i found this one [link] (developer.salesforce.com/docs/component-library/bundle/…) that should be already integrated with google api. When I search an italian address and I select the item, the province field is not populated ad you can see in the screen. I tryed to manage the on change event to see what the event return (first screen) and as you can see the province attribute is empty. Sep 21, 2021 at 15:12
  • is that an event from google's api? if so, I fail to see how this question relates to salesforce
    – glls
    Sep 21, 2021 at 15:45
  • It's a standard lwc event. I shared my code. Sep 22, 2021 at 14:47

0