Embed formula link or attachment

Hello softr community

so i intend to perform an embed on my website, to embed document like word, pdf, excel and others so as to allow live editing. so all is being set up except in terms for a formula that will allow either of the link field or attachment to appear on the website.

the circled part is the focus…

let take for instance

  1. display attachment is not empty and the cloud link is empty (formula to display the display attachment and not the cloud link field)
  2. display attachment is not empty and the cloud link is not empty (formula to display one of the field)

Be careful, Attachments inside formula field are not available because Airtable change the link of the attachment every X hours. So formula including attachment fields can’t work properly.

Though for the formula field you would need to write:
IF(AND({display attachment}, {cloud link}=BLANK()), {display attachment}, {cloud link})

To be refined if needed, specifically to add the complete url for embed

1 Like

two things aren’t clear…

  1. are you saying the attchment link might be changed i haven’t noticed that though… but even at that it’s whatever link that airtable gives that will still be displayed

  2. the formula shown only display for the “display attachment field” to show and when it is empty it doesn’t show the other field that is not empty which is the “cloud hosted url”

  1. Yes. Attachments inserted in a formula don’t work.

  2. Is it a a guess or did you try it? It is supposed to display attachment field when the attachment field is not empty and to display could hosted url when attachment field is empty. Though, as I said, some adjustments may have to be done (or not). A live try is necessary in order to know what to be improved

Have you actually seen the formula-generated attachment url fail in a Softr page? I agree it’s not supposed to work, but I haven’t been able to reproduce a failure during page rendering. (It will fail if you copy the url out of the page DOM and wait hours before trying to retrieve it.)

I havent actually seen it but as the Airtable explanation was clear that the url of the attachments would never be changed in the formula field…
I can give it a try but I count on Airtable to give the right info (The url of the attachments are supposed to chnage every how many hours? I don’t remember)

I think there is ambiguity in the airtable support docs. It says both that the urls will not work, and that they are still generated “for backward compatibility.” And they do appear to work immediately after being generated.

And, as long as an attachment url works during the short time window between when it is generated and when the page is finished being rendered, it should not interfere with continued use of this feature in Softr.

Perhaps the url option should be removed then the attachment option should be left… so the embed can only view the attachment since it has less airtable configuration stress

@matthieu_chateau how do i handle a case where the attachment has it’s text with the url of the attachment, a simple work around for that?