web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Need help parsing addr...
Power Automate
Answered

Need help parsing address field

(0) ShareShare
ReportReport
Posted on by 206

HI,

 

I have a web form a client can fill out that comes to email.  I do not control this form, it is by a 3rd party vendor.  They do not enforce State formats, ie, VA,va,Virginia, etc.

 

I have a flow that I had working until the word Virginia changes to VA or is missing totally.

Example:  5600 powell grove dr midlothian va 23112

 

I had it working if it were formatted like this:

5600 powell grove dr midlothian Virginia 23112 with these splits:
trim(split(split(body('Filter_array')[12],' Virginia')?[0],' ')?[sub(length(split(split(body('Filter_array')[12],' Virginia')?[0],' ')),4)])
trim(split(split(body('Filter_array')[12],' Virginia')?[0],' ')?[sub(length(split(split(body('Filter_array')[12],' Virginia')?[0],' ')),3)])
trim(split(split(body('Filter_array')[12],' Virginia')?[0],' ')?[sub(length(split(split(body('Filter_array')[12],' Virginia')?[0],' ')),2)])

Now I see that will not work.

 

I can get the Zip code.  Last(split(outputs('Full_Address'),' '))

  (Full Address is a compose : trim(split(body('Filter_array')[12], ':')[1])    )

What code will help me go:
1 word left of the Zip for the State

2 word left of the Zip for the City

 

Then, throw way those 3 values , leaving the street address?

 

Appreciate suggestions.

 

Thanks!

 

 

Categories:
I have the same question (0)
  • VictorIvanidze Profile Picture
    13,079 on at

    Try an alternative: retrieve the state and the city based on zip.

    Here is an example: https://ivasoft.com/gettimezonebycountrycodeandzip.shtml 

  • MrAutomate Profile Picture
    206 on at

    Victor, thanks for the response.  In general, I prefer to avoid additional platform dependencies wherever possible.  I am sure someone in the community has ran across this and will have suggestions to solve this..

  • BhargavPatel Profile Picture
    660 Moderator on at

    Parsing Street number, State, and Zip is feasible. However, the difficult part will be parsing out the Street Name and City because both of them can be more than one word. You need a comma (,)  at the end of the street name. 

  • VictorIvanidze Profile Picture
    13,079 on at

    Could you share what exactly returns the web form?

  • Verified answer
    MrAutomate Profile Picture
    206 on at

    Sure- This is the output of the Filter array that removes any blank row:

     

    The underlined lines are the relevant lines I need

     

    [
      "Congrats! Sammy Jones just filled out your ZenMaid booking form [Form#946GP]!",
      "HEY SUZIE SMITH!",
      "Congrats! Sammy Jones just filled out your ZenMaid booking form [Form#946GP]!",
      "CUSTOMER INFO",
      " * Name: Sammy Jones",
      " * Email: lhjunk@me.com",
      " * Phone: 8045551212 [tel:8045551212]",
      "BOOKING DETAILS",
      "Name: Sammy Jones",
      "Phone Number: 8045551212",
      "Email: lhjunk@me.com",
      "Address: 5600 powell grove dr midlothian va 23112",
      "Service Time: Unknown Date - ?",
      "Service Details: 1200 sqft, 1 bedrooms, 1 bathrooms",
      "Estimated at: $0.00",
      "Credit Card saved on file: No",
      "Click here to view this lead in ZenMaid [https://app.zenmaid.com/bookings]",
      "PS: Did you know the faster you contact the person above the more likely you are",
      "to guarantee their business? Click the phone number above and get 'em on the",
      "line! ?",
      "© 2023 ZenMaid. All rights reserved.",

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 594

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 281 Super User 2026 Season 1

Last 30 days Overall leaderboard