Open File/Image with external browser without looking up cache

I posted this https://community.appsheet.com/t/expression-to-construct-url-to-reach-to-your-files-by-ignoring-cach... today to share our findings to ignore the cached file/image then open up the most latest files saved in the cloud, but we noticed further the tricks was not perfect so eventually we deleted the thread.

In turn, we come up with new tricks to open up the files saved in the clouds without referring to the cache, but look up the saved files.

Let me explain.

First, there is URL which reach out to your target file, using expression we introduce on other post.

CONCATENATE(โ€˜https://www.appsheet.com/template/gettablefileurl?appName=โ€™, ENCODEURL(CONTEXT(AppName)), โ€˜&tableName=โ€™, ENCODEURL(CONTEXT(Table)), โ€˜&fileName=โ€™, ENCODEURL( [IMAGE]))

Then leave that expression and column as it is.

Once the URL column type is placed, AppSheet is generate system action of โ€œOpen URLโ€

First step is to copy this system action, while we hide it.

Once the copied action is in place, swist the expression for Target (Target URL)

It looks like this.

The URL column name is [PDF Archive] in this sample case, then just add &"&"&UNIQUEID() at the end.

Then attach this copied action to the original position, inline to the URL column.

Once the action is triggered, unique URL is going to be generated and open the external browser.
Again, all the time , URL is unique, just because of the expression above.

After we tested, those unique URL is not refering to the cache, but always start to look into the actual saved file to render and preview in new browser tab.

Just adding new parameter to the end of URL, without key of params, but just pass &uniquevalue at the end to make the URL is always unique whenever it is called. That did a trick.

Some file which is generated by BOT and saved to Cloud is kept updated. When we run a BOT, then file is saved. Then we re-run BOT then new file such as PDF is generated with the same name. But when we click URL to open the file, we are always looking into cache rather than looking into the most latest file with same file name.

We just found a trick not really conducted full investigation, but it seems to work and do what we want.

@Takuya_Miyai

14 20 2,510
20 REPLIES 20

Steve
Platinum 4
Platinum 4

Hi @Steve
Thanks for your lessons, as always.
I did not kwow about it.

This page was useful to learn.

This did works samely.

There are still tons of things we dont know but AppSheet could do.

Jewel
New Member

Good morning @tsuji_koichi & @Steve, Appsheet-ANGELS!!,

Thank you very much for your kind help. I am reading and trying to implement every info that you are sending, but it does not work yet. Maybe I have done something wrong, sorry:

Ok. I have:
On table BOOKING SERVICES, these columns:

  1. [Inv. AGT]

3X_e_5_e5dfb33d8e02f3f43d62b8c57d7fcf1ec6ae1d21.jpeg
โ€œInvoices for Agts/โ€&[Booking ID]&" โ€œ&[Booking Detail ID]&โ€.pdf"

  1. [Inv. AGT Web]


    CONCATENATE(
    โ€œhttps://www.appsheet.com/template/gettablefileurlโ€,
    โ€œ?appName=โ€, ENCODEURL(CONTEXT(โ€œAppNameโ€)),
    โ€œ&tableName=โ€, ENCODEURL(CONTEXT(โ€œTableโ€)),
    โ€œ&fileName=โ€, ENCODEURL([Inv. AGT2])
    )

  2. [Inv. AGT2] (virtual)


โ€œ/appsheet/data/Supplier XXX/Invoices for Agts/โ€&Concatenate([Booking ID]," โ€œ,[Booking Detail ID])&โ€.pdf"

Then, in the table BOOKING SERVICES I have created an action, which is HIDDEN (โ€œDo not displayโ€)

There is still your sentence, Tsuji, โ€œThen attach this copied action to the original position, inline to the URL column.โ€ which I did not do anything as I did not understand how to do it (despite I have opened several external/community info to research how), sorry.

Could there be maybe the possibility to pay to you (Tsuji or Steve) to help & teach me about this please? I have been already more than 1 month time spent just on this, and I should go forward. I am trying to created 3x very powerful apps which, if successful, I can sell (so, generate many more appsheets to be made worldwide). But without this, it does not make sense and Iโ€™m already getting frustrated :_( I appreciate Very Much your help. THANKS ANGELS!

Is this old screenshot?
Did you make it to File type?

Good eyes! Thanks, corrected.


I have tried again with this correction, but no way yetโ€ฆ

Are you sure if you are firing this custom action instead of system action?

Let me check something plsโ€ฆ I come back to you in 2 minโ€ฆ

you can not change the app default folder name by any action from your appsheet app.
So that part of relative path is static.

I have added this action of the group of actions to fire when the SUPPLIER (our suppliers) click on CONFIRM the service. The result is, the app wants to open a new website with the result, I think, of the document.

Again, just in case:
I am making 2 apps:

  • AGENTS: for our clients, the travel agents
  • SUPPLIERS: for our suppliers (hotels, servicesโ€ฆ)
    How it works?:
    The AGENT books a service > The SUPPLIER confirms: a series of actions are fired:
  • sending the booking details to Accounting (we know when and how much to pay to the Supplier)
  • sending the booking details to Bookings (This is what the Agents will see, all their bookings with all their details of payments, status of the booking if confirmed, cancelled, etc)
  • editing the confirmation page (name of the person who confirms, number of confirmation).

With the Bot, when the Supplier clicks on CONFIRM > the app generates an invoice and saves it in a file of our G.Drive (already working) (The app does NOT need to show that generated PDF to the Supplier, so maybe this action should not be ok for this Supplier App).

On the Sheets of Booking Services writes the link www.appsheet.com/โ€ฆ on this App for SUPPLIER > this link is exported from Booking Services to Bookings Sheets >> The Agents from their another AGENT App can view the link with their invoice (created when the Supplier clicked on Confirm).

Thanks againโ€ฆ!

I m bit puzzled that your exact problem is and what you are trying to do โ€ฆ Sorry for little help from myside.

The opposite, I really thank you and @Steve for your kind help.
This is why I suggested, is there any possibility maybe to pay for your help, so that you can maybe enter into my appsheets to check what is happening please? I am glad to pay for a help, really, no problem.
Sometimes entering into the Appsheet is much quicker than trying to post here a doubt, as I perfectly understand that you cannot get all details from my posts.
Thanks so so much again

Jewel
New Member

I think I know where is the problem!!! Butโ€ฆ I cannot solve it

If we take a look back to the columns we see that the name of the Appsheet is 3X_e_b_eb1a37ed10f80e5d004ed9a927a2180a3efd5232.jpeg
/appsheet/data/Supplier XXX (where XXX is the name of our company, sorryโ€ฆ)

and this is the name that we have input each time needed. Butโ€ฆ If I click on the Sheets cell of the result of the column [Inv. AGT Web] then we have following result:

https://www.appsheet.com/template/gettablefileurl?appName=SupplierHotelXXX-2603799&tableName=Booking%20Services&fileName=%2Fappsheet%2Fdata%2FSupplier%20XXX%2FInvoices%20for%20Agts%2FMiguel%20XXX%20TRAVEL%2037c6a522.pdf

This means it is searching for the app SupplierHotelXXX-2603799 and not as we input before Supplier XXX.
If I say that the tables are โ€œoutโ€ of the file of the App (from each table we will serve several apps), does it affect also maybe?
Thanks!!

I think this is nothing to do with your problem in my opinion.
Folder name os supplier xxx stay static, unless you do something special.

ohโ€ฆ ok Tsuji, thanks so much. Thenโ€ฆ what am I doing wrongโ€ฆ? :_(
Is there the possibility to pay for your help, please, to help/teach me online with me inside my app please? As you are a super expert, sure that if you move yourself freely inside the app you can see it because I understand from these texts it has to be very difficult for you.
And Appsheet team after more than one month have not helped yet (it seems that their form for help did not workโ€ฆ then they were on holidaysโ€ฆ then they gave me even their personal email on Appsheet, they promissed and promissed to answer but no answer yetโ€ฆ Frustrating)

Thanks so much once again, reallyโ€ฆ

Great stuff.

But it should not be this difficult!

AppSheet should be able to return the non cached version of a report as an option [Enhancement].

Hi

Hi Koichi_Tsuji,

I don't know if I'm right... but it looks like when the file is bigger than 2mb... said file doesn't download completely. The file is only download at 115k? I did everything as you explained... besides, I am able to open files of less than 2mb...

Finally, I wonder if I did something wrong?...

That's weird, because I'm contradicting myself a bit... I've clearly been able to open pdf's over 2mb in the past?!?...

Thank you very much for your help in advance.

PREVIEW
 
 
 

Probably related to a recent bug. See  PDF Attachments Error - Google Cloud Community

 

thank you very much Steve.

You are truly of legendary utility.

so I'm going to stop looking... since I didn't change anything either...

Do you know if the bug will be fixed soon...?!

Thank you in advance for your answer.

I do not know when a fix is expected.

Hi Koichi and Steve 

you guys really rock! 
i followed everything but still on clicking the new link action button, it is still showing โ€œbad requestโ€.  

Please help. 

Top Labels in this Space