Hey there! Glad to be part of the community.
I'm trying to update pdfViewer field fileUrl using javascript.
The purpose is that the view I'm editing is supposed to display SQL records.
In these records, there are pdf's links I want to display.
So there will be a list of pdf's but only one pdfViewer component to display them.
So I tried to update this fileUrl field onto the component with pdfViewer2.fileUrl = "https://xxxx.pdf".
I tried it with :
Javascript query witch I ran manually
with an event click handler with run script action
with an event click handler with a Trigger query action
Nothing worked. Maybe I'm using wrong but I think I'have made all verifications.
2 buttons I created just to trigger the update. I did this to be more fast during the test phase. At the very end, only the sql request should update it.
In the query panel, you'll see my send_pdf_url query witch seems wrong since I have read your answer.
@minijohn is correct that you are not able to assign the fileUrl manually. I'd recommend trying to use a JS Query that simply returns the URL and then call that dynamically in the PDFViewer:
Hey @essy!
I don't believe there is a set property on the pdf viewer component at the moment (although this is a great feature request, I'll write this up internally). You can however store this URL in a temporary state (link to our docs on this here) and display the results by triggering a REST query to the URL and displaying the results in the pdfViewer:
Hey @Lebowskar — happy to help here! I'm not sure I follow your use case here though, would you mind sharing a little more about your setup and ideal workflow?
To get started, open your PDF (or create a new one) in a tool like Adobe Acrobat. Then explore these options to add interactive elements to any page: Add buttons: Edit website to PDF > Link > Add/Edit Web or Document Link > Menu Button. Add links: Edit PDF > Link > Add/Edit Web or Document Link.