Adding attachment as a variable in a catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2018 06:59 AM
Hi All,
I would like to add a variable to catalog item and I want this variable to have a label and a button/link to select an attachment.
Any help in how to perform this task is highly appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2018 08:50 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2018 12:13 AM
Thanks RJ for your reply. I actually came across this article but I didn't know how to follow the steps because what I see in the screen is different from what the steps explain, maybe because of difference in versions. I tried to adapt the steps to my case but the macro didn't appear (only its label appeared).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2018 10:48 PM
Hi
1. Create UI Macro
In the "Type Filter Text" search for UI Macro
Create New:
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
7.Change the icon by uploading an icon or choosing one from the image browser (src="images/icons/attachment.gifx" or src="images/pdf.gifx")
8. Change the size of the icon (height="16" or height="25")
Mark correct if it is helpful.
Regards,
Abhijeet Bangera
www.dxsherpa.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2018 01:54 PM
If this were then made Mandatory, could it be used to 'require' a variable via the Service Portal? I have yet to find a way that works via an order Guide and maybe this is the solution?