Make a URL field to open file in local computer folder
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2016 08:36 AM
How to make a field to open a file in local folder location. Need to be a field which containing a URL to open the file. Please help!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2016 09:11 AM
Hello Manoj,
If I understand your question a URL meeting this pattern should work:
file://<path to file>
For example, file://C:\Users\userid\Desktop\ServiceNow\stages_01.gif will open a file named stages_01.gif in the ServiceNow folder on my Desktop.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2016 09:39 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2016 09:15 AM
Hi Manoj,
I believe you are willing to open the records in the computer and want to attach. If my belief is correct, Here you can a Macro to open files in computer folder and can attach these files if you need.
Here is the step-by-step procedure:
1. Create UI Macro
1a. In the "Type Filter Text" search for UI Macro
1b. Create New:
1c. Paste the following code:
- <?xml version="1.0" encoding="utf-8" ?>
- <j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
- <b>Use the paperclip</b>
- <a onclick="saveCatAttachment(gel('sysparm_item_guid').value, 'sc_cart_item')">
- <img title="Attachments..." height="16" src="images/icons/attachment.gifx" border="0" width="16"/></a>
- <b>to attach items to this request.</b>
- </j:jelly>
2. Add a Variable to your Catalog Item.
3. Type-- UI Macro
4. Choose your newly created macro in step 1.
5. It should show up on your form (see attachment) it is clickable and functions just as the OOB paperclip icon on the top right of forms.
6. If you want change two attributes in the code above
6a. Change the icon by uploading an icon or choosing one from the image browser (src="images/icons/attachment.gifx" or src="images/pdf.gifx")
6b. Change the size of the icon (height="16" or height="25")
Try out your UI macro.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2016 09:44 AM
Thanks Suresh for the reply.
I have tried creating a UI macro and UI formatter, which in turn creates a hyperlink on a table form but its not opening the file location in the local folder of my (file:\\C\folder\document.docx).
Please find below image. Any technique is fine for me like using UI macro or any but i need help, if we click on the link it should to go to local folder file location. Thanks for your help.