# Address fields & Trimming

**URL:** <https://community.glideapps.com/t/address-fields-trimming/19675>\
**Category:** Feature Requests\
**Created:** [December 10, 2020, 6:21pm UTC](https://community.glideapps.com/t/address-fields-trimming/19675 "2020-12-10T18:21:09Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nathan](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@Nathan](https://community.glideapps.com/u/Nathan)\
**Post date:** [December 10, 2020, 6:21pm UTC](https://community.glideapps.com/t/address-fields-trimming/19675/1 "2020-12-10T18:21:09Z")

</div>

Hello Glide Community and Team,

Let me start by saying I’ve been really enjoying building with Glide and am excited to see it continue to grow and improve.

For awhile in the process of building my app, I’ve wished that entry fields had more configuration options for inputs (ranging from changing the error message shown for existing min/max violations to automatically formatting phone numbers or currency values on screen). I also wish that there were address specific entry fields so that, for example, state and zip code could be combined on one line as two fields to save space. Though, I’m actually considering trying to implement an auto fill for city and state (US addresses only) based off of an entered zip.

However, I’m making this post because during UAT I recently had a user include a page break at the end of the street entry as well as a trailing space after her name. This caused several display problems down the row, especially because I concatenate the address into one “easy” line.

The documentation for entry fields on the website seems a bit limited, as it wasn’t until digging on the forums here that I discovered email address fields apparently automatically trim whitespace. If anyone knows of a way to get other fields to do this, I’d be excited to hear about it. I really don’t want to have to implement additional columns in google sheets with an array formula trim function because I can only imagine the performance issues that’d cause in addition to the headache of rebuilding so many things.

**Glide team, can we please get the ability to set entry fields to trim white space?**

Thanks!  
N

---

<div class="post-metadata">

**Author:** ![Lucas\_Pires](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lucas_pires/32/64863_2.png) [@Lucas\_Pires](https://community.glideapps.com/u/Lucas_Pires)\
**Post date:** [December 10, 2020, 6:36pm UTC](https://community.glideapps.com/t/address-fields-trimming/19675/2 "2020-12-10T18:36:51Z")

</div>

+1

---

<div class="post-metadata">

**Author:** ![Pablo\_books](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pablo_books/32/2110_2.png) [@Pablo\_books](https://community.glideapps.com/u/Pablo_books)\
**Post date:** [December 10, 2020, 7:04pm UTC](https://community.glideapps.com/t/address-fields-trimming/19675/3 "2020-12-10T19:04:39Z")

</div>

Yes! And maybe there could be a button that opens up mapbox and asks them to select the address!

Great idea! Why don’t you create a feature request on the feature requests site?

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [December 11, 2020, 1:44am UTC](https://community.glideapps.com/t/address-fields-trimming/19675/4 "2020-12-11T01:44:55Z")

</div>

+1 for this.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [December 11, 2020, 2:28am UTC](https://community.glideapps.com/t/address-fields-trimming/19675/5 "2020-12-11T02:28:23Z")

</div>

Agreed that more functions like this in Glide would be super useful.

A kind of hacky workaround for “post entry data validation” is to use a trigger to fire a function that tidies things up. I’ve done this before - in fact I’ve used it for your exact use case - to remove trailing whitespace.

---

<div class="post-metadata">

**Author:** ![Nathan](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@Nathan](https://community.glideapps.com/u/Nathan)\
**Post date:** [December 14, 2020, 11:08pm UTC](https://community.glideapps.com/t/address-fields-trimming/19675/6 "2020-12-14T23:08:28Z")

</div>

Continuing the discussion from [Address fields & Trimming](https://community.glideapps.com/t/address-fields-trimming/19675/3):

Hm I didn’t realize there was a separate site for feature requests. Do you have the link?

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [December 14, 2020, 11:19pm UTC](https://community.glideapps.com/t/address-fields-trimming/19675/7 "2020-12-14T23:19:01Z")

</div>

that is what am looking for, also with option to filter items for location range

---

<div class="post-metadata">

**Author:** ![Nathan](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@Nathan](https://community.glideapps.com/u/Nathan)\
**Post date:** [December 15, 2020, 12:43am UTC](https://community.glideapps.com/t/address-fields-trimming/19675/8 "2020-12-15T00:43:39Z")

</div>

Do you mean to triggering a google apps script, zapier, or something else? Can you walk me through how your hacky approach worked?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [December 15, 2020, 1:55am UTC](https://community.glideapps.com/t/address-fields-trimming/19675/9 "2020-12-15T01:55:41Z")

</div>

Sure.  
Yes, I use App Scripts that are fired by an `ON CHANGE` trigger.

Following is an example from one of my projects that gets fired every time a change is made to my Users sheet. I’ve annotated it, but it just does two things:

1. Removes trailing white space from all user names (this happens a lot when people copy/paste)
2. Reformats a couple of date/time columns for better readability.

> **Summary**
>
> ```
> function tidy_users() {
> var ss = SpreadsheetApp.getActiveSpreadsheet();
> var sheet = ss.getSheetByName('Users');
> // Cols 14/15 are the created_at and updated_at dates. Set to a more readable date format
> sheet.getRange(2,14,sheet.getLastRow(),2).setNumberFormat('yyyy-mm-dd hh:mm:ss').setHorizontalAlignment('left');
> // Remove any trailing whitespace from user names
> for (var row=2; row<=sheet.getLastRow(); row++) {
> var name = sheet.getRange(row, 3).getValue();
> sheet.getRange(row,3).setValue(name.trim());
> }
> }
> 
> ```

---

<div class="post-metadata">

**Author:** ![Pablo\_books](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pablo_books/32/2110_2.png) [@Pablo\_books](https://community.glideapps.com/u/Pablo_books)\
**Post date:** [December 15, 2020, 4:55pm UTC](https://community.glideapps.com/t/address-fields-trimming/19675/10 "2020-12-15T16:55:57Z")

</div>

> **[Feature Requests](https://features.staging.glideapp.io)**
>
> Feature requests for Glide Apps

---

<div class="post-metadata">

**Author:** ![Nathan](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@Nathan](https://community.glideapps.com/u/Nathan)\
**Post date:** [December 15, 2020, 5:54pm UTC](https://community.glideapps.com/t/address-fields-trimming/19675/11 "2020-12-15T17:54:42Z")

</div>

This is awesome and definitely better than nothing. Have you noticed any performance impact? My concern about implementing this in my application is that I’d probably point it at around 10 different columns, and ON CHANGE will start firing pretty frequently for my table in question. I’m worried that it’d cause issues with Glide’s data sync. I’ve also noticed an issue where if the Glide app refreshes with new information from google sheets it seems to reset to the main page and users lose any information in a form they were working on. If that started happening more it’d be troublesome.

---

<div class="post-metadata">

**Author:** ![Nathan](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@Nathan](https://community.glideapps.com/u/Nathan)\
**Post date:** [December 15, 2020, 5:54pm UTC](https://community.glideapps.com/t/address-fields-trimming/19675/12 "2020-12-15T17:54:53Z")

</div>

Thanks! I appreciate you.

---

<div class="post-metadata">

**Author:** ![Nathan](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@Nathan](https://community.glideapps.com/u/Nathan)\
**Post date:** [December 15, 2020, 6:05pm UTC](https://community.glideapps.com/t/address-fields-trimming/19675/13 "2020-12-15T18:05:41Z")

</div>

For anyone who wants to give this a +1 in the feature request app, here’s the link: [https://features.staging.glideapp.io/dl/ewAiAHQAIgA6ADMALAAiAHMAIgA6ACIAYwBsAGEAcwBzAC0ARgBlAGEAdAB1AHIAZQBzACIALAAiAHIAIgA6ACIAYgByAHIAMABGAGsAMwBzAFEAdABDAEUAQQBuAHAAVQBiAGEANAB2ADMAZwAiACwAIgBuACIAOgAiAFQAcgBpAG0AIABFAG4AdAByAHkAIABWAGEAbABpAGQAYQB0AGkAbwBuACAAZgBvAHIAIABXAGgAaQB0AGUAIABTAHAAYQBjAGUAIgB9AA%3D%3D](https://features.staging.glideapp.io/dl/ewAiAHQAIgA6ADMALAAiAHMAIgA6ACIAYwBsAGEAcwBzAC0ARgBlAGEAdAB1AHIAZQBzACIALAAiAHIAIgA6ACIAYgByAHIAMABGAGsAMwBzAFEAdABDAEUAQQBuAHAAVQBiAGEANAB2ADMAZwAiACwAIgBuACIAOgAiAFQAcgBpAG0AIABFAG4AdAByAHkAIABWAGEAbABpAGQAYQB0AGkAbwBuACAAZgBvAHIAIABXAGgAaQB0AGUAIABTAHAAYQBjAGUAIgB9AA%3D%3D)

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [December 15, 2020, 8:07pm UTC](https://community.glideapps.com/t/address-fields-trimming/19675/14 "2020-12-15T20:07:30Z")

</div>

Voted—would love an “address component” that will autofill the mailing address of record upon typing the address—most appstore/playstore apps have this functionality when it comes to addresses.

---

<div class="post-metadata">

**Author:** ![Nathan](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@Nathan](https://community.glideapps.com/u/Nathan)\
**Post date:** [December 15, 2020, 8:39pm UTC](https://community.glideapps.com/t/address-fields-trimming/19675/15 "2020-12-15T20:39:10Z")

</div>

I went and filed that as a separate feature request, since I do think both would be tremendously valuable to my use case.

> **[Feature Requests](https://features.staging.glideapp.io/dl/ewAiAHQAIgA6ADMALAAiAHMAIgA6ACIAYwBsAGEAcwBzAC0ARgBlAGEAdAB1AHIAZQBzACIALAAiAHIAIgA6ACIAYQAtAHYAaQBLAFYATgAwAGoAUwBJAGkAagBWAGcAaAAyAHIAcwBIAHMAbABRACIALAAiAG4AIgA6ACIAQQBkAGQAcgBlAHMAcwAgAEUAbgB0AHIAeQAgAEYAaQBlAGwAZAAiAH0A)**
>
> Feature requests for Glide Apps

I actually took a crack at implementing a zip code based city/state autofill, but wasn’t able to because the number of records to reference in a zip code database results in more rows that Glide supports for an app.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [December 16, 2020, 1:22am UTC](https://community.glideapps.com/t/address-fields-trimming/19675/16 "2020-12-16T01:22:41Z")

</div>

> [@Nathan](#):
>
> This is awesome and definitely better than nothing. Have you noticed any performance impact? My concern about implementing this in my application is that I’d probably point it at around 10 different columns, and ON CHANGE will start firing pretty frequently for my table in question. I’m worried that it’d cause issues with Glide’s data sync. I’ve also noticed an issue where if the Glide app refreshes with new information from google sheets it seems to reset to the main page and users lose any information in a form they were working on. If that started happening more it’d be troublesome.

No, I haven’t noticed any performance impact at all. I use triggers extensively in almost all of my projects and they are constantly firing when an app is in use (think multiple times per minute).

Bear in mind that ON CHANGE will fire whenever there is a change _anywhere_ in the worksheet, so your triggers need to use some additional logic to determine whether or not to take any action.

Here is another example - this is the script that actually gets called by the ON CHANGE event, and then it calls additional helper scripts as necessary.

> **Summary**
>
> ```
> function on_sheet_change(event) {
> var sheet = event.source.getActiveSheet();
> var sheetname = sheet.getName();
> if (sheetname == 'Feedback') {
> format_time_cols(sheetname, 2, 1);
> }
> else if (sheetname == 'Users') {
> tidy_users();
> }
> else if (sheetname == 'User Summaries') {
> format_time_cols(sheetname, 17, 1);
> }
> else if (sheetname == 'Users-Languages') {
> check_for_deleted(sheetname);
> }
> else if (sheetname == 'Users-Ethnicities') {
> check_for_deleted(sheetname);
> }
> else if (sheetname == 'Users-Orgs') {
> check_for_deleted(sheetname);
> format_time_cols(sheetname, 5, 1);
> }
> format_sheet(sheetname);
> }
> 
> ```

---

<div class="post-metadata">

**Author:** ![kyleheney](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kyleheney/32/41173_2.png) [@kyleheney](https://community.glideapps.com/u/kyleheney)\
**Post date:** [December 16, 2020, 1:25am UTC](https://community.glideapps.com/t/address-fields-trimming/19675/17 "2020-12-16T01:25:42Z")

</div>

Seeing the discussion on API integration in staging… I would think there should be a way to incorporate some sort of address lookup API using this new feature. I have absolutely no idea though as I have zero knowledge or experience with APIs… Just sounds like it _should_ be possible.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [December 16, 2020, 1:28am UTC](https://community.glideapps.com/t/address-fields-trimming/19675/18 "2020-12-16T01:28:01Z")

</div>

It should be available, but those comes with additional cost.

---

<div class="post-metadata">

**Author:** ![Nathan](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@Nathan](https://community.glideapps.com/u/Nathan)\
**Post date:** [December 16, 2020, 1:47am UTC](https://community.glideapps.com/t/address-fields-trimming/19675/19 "2020-12-16T01:47:27Z")

</div>

I actually use a lot of integrations with Zapier. A more direct API integration would be really awesome.

For my use case, I don’t think I’d be able to use an API for address lookup because my address entry is on a form. I can’t think of a way to get that form entry field to trigger any API calls. I haven’t gone and looked at what they’re building in staging, though.
