Using a button in a row to open a link or file

Coda newbie here.

I’m organizing a huge list of clinical resources. Some of them are links and others are PDFs. The PDFs are files that are hosted in Coda.

I’d like to create a button (“Get It”) that either opens the PDF (when there is one) OR opens the link (when there is one). None of the rows will have both a file and a link.

I’ve got the link figured out using thisRow.Link.OpenWindow( ). But how can I take it a step further to open the link or the PDF, depending on which the row has?

Thanks a million!

hi,
You can use If or switchIf.

Example :

switchIf(
pdf.isNotBlank(), “open PDF”,
url.isNotBlank(), “open link”,
“missing files”
)

2 Likes

Amazing thank you! That’s a big help.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.