- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2020 11:24 PM
Greetings.
As you know, we can add File Attachment field on a form.
Is it possible to add the same to a service catalog item as a variable? I couldn't find the file attachment variable type ..
Thanks.
Solved! Go to Solution.
- Labels:
-
Scoped App Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2020 11:33 PM
Hi,
This can be done through UI macro/ UI Page. There is a article related to this.
refer: https://hi.service-now.com/kb_view.do?sysparm_article=KB0529497 for same.
Pls. mark this correct/helpful, if applicable.
Thanks.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2020 08:15 AM
Hi Raghav,
Actually project is running on Orlando version.
for widget I have used the same following one:
I went to Service Portal --> Widgets --> under Body HTML template kept this one.
<div>
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<button type="button" onclick="saveCatAttachment(gel('sysparm_item_guid').value, 'sc_cart_item')">Add Attachment</button>
</j:jelly>
</div>
Thanks,
Koushik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2020 08:15 AM
Hi Raghav,
Actually project is running on Orlando version.
for widget I have used the same following one:
I went to Service Portal --> Widgets --> under Body HTML template kept this one.
<div>
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<button type="button" onclick="saveCatAttachment(gel('sysparm_item_guid').value, 'sc_cart_item')">Add Attachment</button>
</j:jelly>
</div>
Kindly suggest me.
Thanks,
Koushik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2020 08:32 AM
You are writing jelly in widget which is not supported.
Refer: https://community.servicenow.com/community?id=community_article&sys_id=5df1797b1b0c5050fff162c4bd4bcb3f
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2020 11:39 PM
Hi,
When using a UI macro as an item variable, an attachment link in the code works when browsing the item.
-
Create a UI macro and include add attachment link in the code.
For example: <?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>
-
Create a variable and set the condition Type is Macro. Use the macro you just created.
-
Attach the variable to a service catalog item and try the item.
If my answer helped you in any way, mark answer as helpful and correct.
Thanks and regards,
Megha.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2020 12:47 AM
Thanks Megha. I'll try this and feedback later.