
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Can Appscript or Modscript read in External Files and attach them to items?
Hello,
We are migrating attachments from another tool into SBM.
The SBM records should have the filenames within them. So, I would like to create an Appscript or Modscript to read the items filename and then go out to a directory and upload the file as an attachment.
Is this possible and does anyone have a code sample?
Regards,
Will

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Yes, It can be achieved by SBM Appscript / Orchestrations. Below are my questions,
May I know your file locations? Is it inside application server or outside?
Is your attachments are stored in file system or database? If it is stored on database, you can't achieve by app script.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I am storing my attachments within the SBM database.
If it can't be done with appscript how about Mod script?
Maybe I need to go to plan B and put the attachments into Dimensions and somehow provide a link to the files within Dimensions.
Thanks for responding.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
@redbug2 Is this a one-time-only import? If so, it might be easier to create the attachment and attachment sequence records in SQL.
Even though you've configured attachments to go into the database, I'm betting that you can put the file into the file system, create records in TS_ATTACHMENTS and TS_ATTACHMENTSEQUENCES and the file will be magically imported into the database (the TS_BLOBS table) after you restart SBM.
The trick is that you need to be comfortable doing things with the SBM database and definitely need to know the table schema.