Dynamic Attachment based on choices

harshi_ramesh
Tera Expert

Hello people

I have a requirement to show 'Downloadable' template file under a field on a catalog form. The catch is, this file will change based on the selection or combination of selections made on two fields of type 'SelectBox'.
Variable1 has 4 choices, Variable2 has1 choices.
Example Scenario:
Variable1 -> Option A selected
Variable2 -> Option 1 selected.

So, on basis of this, respective file template should be shown under 'Upload Template'(Type is attachment). User can click on the template and get the template downloaded.

Unser Annotation of 'Upload Template' we have 'Insert/edit Link' but it remains static. We need the link to change.

I tried few ways but nothing seems to work as required. 
Any idea on how to crack this? Would be helpful! 🙂

Appreciate your time and effort.

Thanks

1 ACCEPTED SOLUTION

kaushal_snow
Mega Sage

@harshi_ramesh ,

 

I have worked on this scenario in the past, you can implement dynamic attachments in your catalog item by using a Rich Text / HTML variable (or custom widget variable) whose content (an <a> download link pointing to a sys_attachment.do?sys_id=…) gets set via a client script triggered by changes in your select boxes, with the sys_id value returned from a GlideAjax/Script Include that queries the sys_attachment table based on those field values......

 

If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/

View solution in original post

6 REPLIES 6

Hi @kaushal_snow 

 

Yes, I finally cracked it. Used catalog client script with a hidden variable of type HTML.

Thanks for the responses.

@harshi_ramesh , Glad !!

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/