Occasional issues with displaying images from URLs - May be related to caching?

In my app, I have an Image column which just consists of an app formula that calls an URL to retrieve an image. The app formula is as follows:

 

CONCATENATE(
"https://barcode.tec-it.com/barcode.ashx?data=",
ENCODEURL([UID]),
"&code=&multiplebarcodes=false&translate-esc=false&unit=Fit&dpi=72&imagetype=Jpg&rotation=0&color=%23000000&bgcolor=%23ffffff&codepage=&qunit=Mm&quiet=0"
)

 

Most of the time, this works fine, however, occasionally AppSheet does not seem to get an image back, so the app just displays either an empty image or a placeholder image from the website (not sure if there is a pattern on when it does one or the other). If I sync the app again, AppSheet does not seem to try the URL again, as it still shows an empty image. If I paste the URL into a browser, the barcode image comes back fine, so it is not the URL that seems to be the issue.

I tried to make a virtual column to force AppSheet to recompute the Image column, but it still just showed a blank image.

Now, after some time (seems like this can vary from some hours to days), the barcode image suddenly shows up as it should, indicating that some sort of caching issue is in play perhaps (e.g. the cache expired, AppSheet called the URL again, and retrieved the image correctly, but this is just speculation). Also, if I "force" AppSheet to retrieve the URL again, by changing the URL in the Excel sheet, sync the app, change the URL back to the original one and sync the app again then it will retrieve the barcode image correctly, but of course, this is not a feasible solution.

So, summed up; how can I make AppSheet retrieve an image from a URL if it didn't retrieve it correctly the first time? I hope this makes sense, if not, please ask away.

Best regards
Viktor

Solved Solved
0 6 573
1 ACCEPTED SOLUTION

My comment wasn't precise enough, I'm going to clarify.

URL on an image column is OK.

The thing is that if you are using it on your AppFormula, AppSheet will try to change it every sync.

It's better to have that kind of things on an Initial Value so that the barcode/QR URL is created once.

Take a look at a sample app that I made:

portfolio of mobile apps created with AppSheet

View solution in original post

6 REPLIES 6

Mmm, just to troubleshoot, is this an AppFormula or Initial Value?

It is an app formula, to ensure that Appsheet recomputes the column, but even when it recomputes it, it doesn't seem to actually call the URL, but rather fetch the previous result

I think you should not expect to work properly if it's a code thar will be recomputed everytime.

I don't suggest the usage of any image URL on AppFormula

I would agree on that, generally it seems unreliable to use an external URL as an image source. However, I am not sure what a good work around would be in order to get a barcode into the app? I don't suppose Appsheet has support for generating barcodes without the use of some external aid

My comment wasn't precise enough, I'm going to clarify.

URL on an image column is OK.

The thing is that if you are using it on your AppFormula, AppSheet will try to change it every sync.

It's better to have that kind of things on an Initial Value so that the barcode/QR URL is created once.

Take a look at a sample app that I made:

portfolio of mobile apps created with AppSheet

I see. I'll try and experiment with having the formula as an initial value rather than an app formula. Thanks for the clarification!

Top Labels in this Space