How do I check if a URL pointing to a PDF (in a File column) actually returns the PDF?

Iโ€™m working on an app that links a โ€œunitโ€ to a PDF document if said document exists. This is done with a โ€œFileโ€ column and then a predetermined URL in the app formula. However, I need to be able to check whether a PDF is actually returned or whether the link points to nothing since the PDF might not exist when the unit is created in the app, and the choices a user can make depends on whether the PDF exists or not.
Iโ€™m assuming a simple ISBLANK() wonโ€™t do it, because Iโ€™m using an app formula, so the column is technically never blank even though a PDF isnโ€™t retrieved.

Thanks in advance!

Solved Solved
0 8 2,569
1 ACCEPTED SOLUTION

Firstly appsheet will check the files beyond the URL โ€œwhen the url is clickedโ€. If no files exist, error is returned.

Without users interaction, i.e. clicking the url by user, Appsheet has no way to check if the URL is valid or not.

View solution in original post

8 REPLIES 8

Create number type data field, and set initial value to 0 for instance.
Crete action to incrementally increase this number.

Workflow event to send email once the change is made this fields, while the [_thisrow_before]<>0

In case the value for this fields is more than 1, natually the workflow should have been fired, i.e. the PDF should have generated (unless workflow fails due to some event).

Show your URL fields which hold the link to PDF file only the number of this fields is more than 1.

Thank you for your suggestion!
I should probably have mentioned, the PDF is not generated by Appsheet, it is generated and uploaded outside the app, so I donโ€™t think this approach can work as it wonโ€™t know when the workflow should fire.

AH Okey.

Appsheet no way to detect if or not the PDF file exist unless it is generated by Appsheet workflow.

Possible workaround if you capture the fact on the data base when the new pdf files are saved to your cloud, which acts are โ€œflagโ€, then appsheet read that data table, then use showif constrain to toggle the data filed.

Hmm, I see. I was thinking in something along the lines of: when Appsheet checks the URL, I assume it will get a HTTP status code back (200 if success, 404 if no PDF is present), so couldnโ€™t that somehow be used?

Firstly appsheet will check the files beyond the URL โ€œwhen the url is clickedโ€. If no files exist, error is returned.

Without users interaction, i.e. clicking the url by user, Appsheet has no way to check if the URL is valid or not.

Okay, so if I have the URL in an app formula, Appsheet doesnโ€™t actually check the URL before a user clicks on the link?

Correct.

I see. Thank you for the explanation!

Top Labels in this Space