Is there a way to hide the state/zip/country when I display an address in a dynamic field? All my users are local, so there is no need for this extra info.
Sorry if this question is vey basic and i just missed something obvious. Thanks in advance!
I played around with :extract, and it seems that the feature would be helpful if I wanted, say, just the city name extracted from the address and nothing else.
However, iâm having to jump through hoops to get it to show me an address like â1234 Fake St Apt. 3, Dallas, Texasâ. âStâ is extracted as âStreetâ and I canât get it to dynamically show if itâs âApt.â or âSuiteâ or â#â, etc.
It would be useful to have a feature like inverse-truncate where I can eliminate the last n characters from a string. But seeing that Iâm apparently the first person to ask this on the forum, there doesnât seem to be a big demand for it. I may have to just deal with long addresses for the time being.
Truncate from end seems to give you only a certain number of characters, but starting from the end. So, in this case, it would only give me state, zip, and country, which is exactly what i DONâT want.
Oh sorry, try âtruncate toâŠâ instead. Youâll need to determine the string length that you want to maintain, which is found by the stringâs number of characters and subtracting n.
Ok Scott, I used your idea of taking the stringâs :number of characters and subtracting n. However, the editor wouldnât let me just do something like:
Current Contactâs>Addressâs>Formatted Address>truncated to>Current Contactâs> Addressâs>Formatted Addressâ>Number of characters> -15
(The 15 above is the sum of the characters in the address zip, state, and country, including spaces and commas).
So I had to come up with a workaround. It worked, but it wasnât pretty. Here it is:
I made a new field in my Contact thing called âAddress String Lengthâ. Whenever a new Contact is created and an address is inputted and saved, the field âAddress String Lengthâ will be automatically populated with Current Contactâs> Addressâs>Formatted Address>Number of characters> -15
Elsewhere, in the field where i want to display a truncated address, I dynamically set the contents of that field to Current Contactâs>Addressâs>Formatted Address>truncated to>Current Contactâs>Address String Length
It works.
So, essentially, what Iâm doing is taking the number of characters in the address, subtracting 15 (which is the number of characters that I want to eliminate from the end of the address) and saving that amount to the database as a number in a field of the relevant thing. Then I use that number as the value of the number of characters used to truncate the address.
Geez this is hard to explain. I think itâs solved. But if anybody ever reads this in the future and comes up with a better workaround, Iâm all ears!
Hey, thanks for that new perspective on the problem. I actually decided to go with your way and using find and replace to remove the zip code and the â, USAâ at the end of my addresses.
I donât regret all of the tinkering I did because I learned some new things. But, per usual, there was an easier way. Thanks @mishav