Make an external link to look up a term in your data

Iโ€™m building an app based on a list of about 8,000 English words that students of English should know. Detail views in the app have hyperlinks that take the user to external websites where the key term will be looked up automatically. In this little tip Iโ€™d like to show two ways of doing this. One relies exclusively on virtual columns and the other only uses real columns. Iโ€™m assuming that the second method would yield better performance, particularly on devices that are not very powerful, but I hope to get that confirmed by any experts who might do me the favor of looking at this tip.

Method one: Hypertext virtual column

Make a virtual column with a formula such as the following:

. . . to look a word up in Merriam-Websterโ€™s online dictionary

HYPERLINK(Concatenate("https://www.merriam-webster.com/dictionary/",[Your word]),"Merriam-Webster")

. . . to look something up on Oxford Learnerโ€™s Dictionay

HYPERLINK(Concatenate("https://www.oxfordlearnersdictionaries.com/definition/english/",substitute([Your Word]," ","-")),concatenate("Oxford Learner's Dictionaries"))

Note that any spaces will need to be replaced with โ€œ-โ€ on this website if you have two or more words separated by spaces. Space separation is handled differently on different sites. You might need to use INDEX(SPLIT([Your Word]," "),1) to select just the first word some sites. Or, you may need to replace spaces with โ€œ+โ€. You just need to experiment with the URL to see how your target site works.

. . . to do a Google Image search for your word

HYPERLINK(concatenate("https://www.google.com/search?hl=en&q=",[Your word],"&source=lnms&tbm=isch"),"Google Images")

. . . to do a Google news search for it

HYPERLINK(concatenate("https://news.google.com/news?q=",[Your word],"&hl=en"),"Google News")

All of these virtual columns will make linking actions that you can use in your app. Moreover, if you adjust the formula in your virtual column, the behavior of the action will be adjusted automatically.

Method two: Avoiding virtual columns

If you make an action directly (no intervening virtual column), you can use the CONCATENATE() part of the formulas above in the โ€œURL Targetโ€ slot. Then, if you know, for example, that you always want the text โ€œMerriam-Websterโ€ to show for that dictionary link, you can put the text โ€œMerriam-Websterโ€ in a real column and then put your action on that column as a Display Inline action. This completely eliminates the virtual column, making everything either a real text column or an action.

Confirmation please

The virtual column method seems to be the conventional one. AppSheet, for example, has a sample app that shows how to make an external link with a virtual column:

https://www.appsheet.com/samples/How-to-link-to-a-URL-with-custom-text?appGuidString=3f55edfc-aa53-4...

However, my app has about 8,000 words to be looked up and links to about 25 different external resources per word. The app seems to work well on my computer and on my iPhone (even my legacy iPhone 6) but itโ€™s so slow as to be unusable on my Android device. My question is: On an app with many rows and many links, can I expect significantly better performance from method two than from method one? The number of real columns in the table will increase (I need them to โ€œhangโ€ my hyperlinks on) but the number of virtual columns will decrease by the same number.

1 6 753
6 REPLIES 6

Steve
Platinum 4
Platinum 4

Both are bad. Consider instead an action button.

Thanks! I thought the second method was a sort of action button (the link). Do you mean that I should make an action that writes the URL to the sheet?

I thought I would put a CONCATENATE() expression in an action. Does that wind up being the same as a virtual column, in terms of efficiency, even though Iโ€™m not technically using a virtual column?

Iโ€™m suggesting an action to navigate the user to the definition page, of type External: go to a website. I donโ€™t really see any need to write anything to the table.

Iโ€™m glad to know that I need a different approach.

I wonder if I could request that my โ€œTips and Tricksโ€ be changed to a normal question. I thought that my second approach would be a better one because it doesnโ€™t use virtual columns. But, since I was mistaken, I think itโ€™s better that this not clutter up the โ€œTips and Tricksโ€ category. Thanks!

Postscript: After further discussion I think itโ€™s clear that my basic idea (avoid virtual columns by putting the expression in an action) was OK after all. So, maybe this can stay a โ€œtipโ€ for now.

Iโ€™ve noticed that many of the official sample apps from AppSheet are NOT built using good practices.

Take the โ€œWorkstation Trackerโ€ sample app, inside Iโ€™ve found the following โ€œbad practicesโ€ on one table alone

  • The RED outlined VCs shouldnโ€™t be VCs
  • The GREEN outline VC should use a (slice)
  • The โ€œRelated Distance Checkerโ€ columns donโ€™t need to be REFโ€™ed

The RED outlined VCs shouldnโ€™t be VCs

  • They should be physical columns

This is because they donโ€™t contain data that changes dynamically; the data they contain only change based on changes to the record.

  • When youโ€™ve got data points like that, you donโ€™t store that computed value inside a VC - you store it in a physical column with an app formula.

The GREEN outline VC should use a (slice)

The Occupied column uses a brute-force SELECT() (ported into a FILTER formula) to pull any ongoing workstation checkouts.

  • This should instead be a REF_ROWS() to a slice of the ongoing workstation checkouts.

When you implement a (slice) to create a sub-set of data like this, AppSheet uses internal systems to increase efficiency when doing all the โ€œsorting which child records go with which parent.โ€

  • If you leave it with a brute-force SELECT() like that, youโ€™re forcing the system to work harder than it needs to

The โ€œRelated Distance Checkerโ€ columns donโ€™t need to be REFโ€™ed

I assume the โ€œDistance Checkerโ€ table was implemented before enum base-type refs were a thing. The references on that table should be replaced with enum columns to remove the unecessary reverse references inside the workstation table.


These are the problems Iโ€™ve found with just one table in one sample app.

I wouldnโ€™t assume that what you see in an โ€œofficial sample appโ€ is necessarily the โ€œrightโ€ way to go

  • Same can be said for โ€œunofficialโ€ sample apps too


That being saidโ€ฆ I agree with @Steve - using actions for your external links is definitely the way to go.

Thanks to both @Steve and @MultiTech_Visions for your helpful responses.

Top Labels in this Space