How to add an attachment functionality in a service portal page?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2016 12:06 AM
I have this page to record data and I want to add an attachment functionality where users can add attachment in service portal.
Do you have an idea how to do it?
Please advise.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2016 04:58 AM
Hi Hardik,
You can fork it in github GitHub - bhanucvbmg/CreateTicketSnow: CreateTicketSnow , forking is welcome
joanmarisse can you mark the post as solved, if your issue of attachments is solved..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2017 12:47 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2017 01:11 AM
Hi Nitish,
Currently, I'm into other development, maybe with with recent upgrades the issue might be happening. So can't help much.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2017 05:24 PM
Hi Bhanu
Thank you so much for your reply 🙂
the thing is that in your code you have not passed authorization parameter ,and i will be doing this on the server side , so if i add auth to your code then it will work fine i guess
can you tell me the syntax using your code where i should add it plus i used this on server side
for(var l=0;l<input.filename.length;l++)
{
if(input.filename[l])
{
var restMessage = new sn_ws.RESTMessageV2();
restMessage.setBasicAuth('xxxxx','xxxxx');
restMessage.setHttpMethod(input.method);
restMessage.setEndpoint('https://xxxxxx.service-now.com/api/now/attachment/file?table_name=sn_customerservice_case&table_sys_...
restMessage.setRequestHeader("Accept","application/json");
restMessage.setRequestHeader('Content-Type',input.type[l]);
//var fle = JSON.stringify(input.file[l]);
restMessage.setRequestBody(input.file[l]);
//restMessage.setRequestBodyFromAttachment(input.file[l]);
gs.log('File Content '+input.type[l]);
gs.log('File Name '+input.filename[l]);
gs.log('File Data '+fle);
//gs.addInfoMessage(input.file[l]);
var response = restMessage.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
gs.addInfoMessage(httpStatus);
}
}
}
the setrequestbody is not uploading/sending the file object data correctly so if you cud perhaps tell me other method as file name and type are loading correctly
I have created a separate question with further details
I am having my UAT , kindly spare some time to help a brother
Load File attachment through widget servicenow portal via public page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 03:26 AM
Nitish, Mail me at bhanucvbmg@gmail.com