Shortening a URL

Im importing some data and a url comes in with additional chars that I need to remove

Ex:

www.mywebsite.com/utm12

Need to convert that to just www.mywebsite.com

Any ideas how to accomplish this?

Is it in Google Sheets?

If so here’s an arrayformula.

={"Shortener";ARRAYFORMULA(IF(A2:A<>"",LEFT(A2:A,FIND(".com/",A2:A)+3),""))}
2 Likes

@ThinhDinh I was thinking how to do everything in Glide but I just don’t seem to find a way. If only we had a kind of ‘single value column’ that does not act on the rows, but on the index of an array, they could solve many cases similar to this.

1 Like

We can definitely do more with some text manipulation ability.

1 Like

This looks to do what I want, thanks! Guessing there isnt a way to sort of import data from a Google sheet into a Glide Table, right?

Currently using a zap to import new rss feed posts into a google sheet. No way to import into a Glide Table, correct?

Yes, correct, for now.

Maybe I can do like a Google Sheet with “Pending Posts” that users can review and when they hit a “Publish” button, it adds a row to my Glide Table…

Hypothetically, can’t you use a Split Text column, using the “/”, and then just grab the first value from the cell of the two items?

You don’t have a way to grab that first value, I believe.

If only there was a kind of fuzzy search with template columns or relations… like in this case, each of the first strings will start with “www”, and you want to ignore everything after the “/”.

Image 2021-07-02 at 7.10.16 PM

I think what I will do is this:

Zapier RSS to Google Sheets (New posts)
Google Sheets Array as Thinh wrote above to find the actual website
Link to Screen → Google Sheet (New Posts)
Button → Add Row to Glide Sheet + Delete Row

That particular formula only works if the TLD is “.com”, hence why I’m trying to use other methods to trim / break up the full URL into pieces, and then grab the piece I want. In the URL shortening services, I wonder if there is this ability, so rather than try to make a bit.ly/a7sg9adasdf , just trim it to the root domain.

Do you know if its possible to shorten to both .com and a .co?

What types of URL do you have? Are they all .com, .co or follow any specific patterns?

Actually I fixed the issue. I need a separate worksheet per User to import their content via IMPORTFEED so I can just customize the Array based on their website TLD.

2 Likes