In AGOL Experience Builder, I want to build an app. The app should function like this: when a user clicks on a polyline in the map widget, the option to open a PDF about that polyline also appears. So maybe I have a polyline outlining a construction area and in My Content I have a georeferenced PDF that is the actual site plan for the the area. When the user clicks on the polyline, an option to open the PDF should appear. I cannot seem to get the trigger in the map widget to work like this however. I have also added an Embed Button in the upper right thinking I can somehow link the URL of the PDF to it, and to the polygon in the map. I cannot figure it out though. Any advice? Thank you.
Solved! Go to Solution.
That's what happened actually. So I just converted the PDF to HTML code and host it on GitHub. So it's working. Thanks for the workflow!
This should be doable and you are on the right track with the Embed Widget.
With this combo, clicking on the feature should pop open the Embed Widget and open it to the webpage with your PDF.
If you have access to a web server with IIS, you could create a virtual directory that points to the pdf file location folder. Then you could add a field in layer that concatenates the virtual directory with the specific file name in html format to access the pdf in your web app. I have done this with numerous web apps at my org.
Mike, thank you are you talking about something like Amazon Web Services? In this case, I believe the steps would be the same as Jeffrey's workflow above, but I'd be using a different URL? I think I would still have a problem opening the PDF in the embed window (please see my response above). When I use other URLs to regular websites (say www.esri.com) the website shows up in the embed folder, but this isn't the case for PDFs it seems. Maybe if I concatenate the virtual directory and the PDF file location folder the PDF shows like a regular web page?
Thanks for your help on this.
I'm also thinking if I convert the PDF to HTML and host it on Github, that might be a work around too.
Are you looking to have the pdf open in a different window of the same web page or will a new browser window open?
For my orgs apps a new browser window opens with below GIS feature class field value where target='blank' opens a new browser window
<a href="https://alias/'Virtual Directory'/'File name.jpg'" target='_blank'>View</a>
My org does not use SharePoint to store our images in public web apps. We tried that, but I believe it might have worked inside the org but failed for the public app itself (Might have been a SharePoint access issue).
Thank you! I will try it this afternoon and let you know how it goes.
You nailed it. It opens in an embed window on the right. Thank you!
One problem however, and that's how the PDF displays. I have saved the PDF in Sharepoint and copied the URL and put it in a field in the layer's attribute table. When I click on a polyline, the attribute table opens with an opportunity to click on View in the URL field, but nothing shows in the Embed window. I am wondering if text should pop-up in the embed window with a URL to the PDF that can be opened in a new window. Something like "Please click here to view the construction drawing."
But I don't know what the code would be to call the URL in the cell in the row that holds the URL:
This may be your problem.
https://doc.arcgis.com/en/experience-builder/latest/configure-widgets/embed-widget.htm
Note:
If you choose to display a PDF directly in the Embed widget, some users may not be able to view it in certain browsers for security reasons.
That's what happened actually. So I just converted the PDF to HTML code and host it on GitHub. So it's working. Thanks for the workflow!