- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2023 10:48 AM
Hello,
There is a Catalog Item which has few fields. Some of the fields are to upload attachments. How to upload files into these variables via ATF?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2023 10:44 PM
Hi @tasankuluulu,
Yes. Follow the below steps.
1) Use the Record Query test steps. Table will be sys_attachment and add the attachment sys_id for query.
2) Open a catalog item
3) Set the variable values and for attachment type variable use the same sys_id.
4) Add your next steps or submit form.
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2024 06:34 PM
Sure, here are the steps (note: To be clear this is for adding an attachment to an Attachment type variable on the form, not the general attachment that appears at the bottom of the entire form which isn't a variable):
- Upload your attachment to any record in the system (eg: the Set variable values ATF Test Step)
- Copy the sys_id the record you added the attachment to
- Navigate to the Attachments table [sys_attachment]
- Search for your attachment by looking for where Table sys ID = <copied sys_id from step #2>
- Clear the Table name column so that it's empty (we also cleared the Table sys ID column, but I don't believe that's required). This makes it so the ATF user that gets impersonated has access to the attachment. Just keep in mind that this will make the attachment available to all users (if you have explicit roles plugin turned on, it'd make it available to all snc_internal users), use whatever method you like to make the attachment readable by your ATF user (whether that's changing ACLs, granting more roles to the user you're creating and impersonating in your ATF etc.), it's up to you - clearing the table name is just one quick way of making it available.
- Copy the sys_id of your attachment record
- Navigate to the Set variable values ATF step which you want to upload your attachment
- Set your attachment variable type equal to the sys_id you copied from step #6 by pasting it.