Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Copy custom variable in record producer to OOTB record producer attachment

ronro2
Tera Contributor

Hey! 

In a record producer I have a custom variable of type attachment called 'bifoga_fil':

ronro2_0-1777024047068.png



So I want to copy this to the OOTB attachment on the record producer in the back-end, so that the attachment is visible in the banner above and in the logs. 

ronro2_0-1777023445003.png


I've marked what I mean with red. 

So, I am thinking an after insert business rule of some kind? What would that look like? 

I'm thankful for your help. 

All good, 

1 ACCEPTED SOLUTION

@ronro2 

the file should get attached to the record if you used the record producer script

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

29 REPLIES 29

hi @ronro2 ,

  1. Navigate to System Applications > Application Cross-Scope Access.
  2. Switch to x_vgll_rail scope.
  3. Click New to create a new record.
  4. Fill in the form as follows:
    • Source Scope: x_vgll_rail (your application scope).
    • Target Scope: Global
    • Target Name: sys_attachment
    • Target Type: Table
    • Operation: Write
    • Status: Allowed
  5. Submit the record. 
 

ronro2
Tera Contributor

I did, but now nothing happens. So no attachment is appearing in the record in back-end. 

ronro2_0-1777273013304.png

ronro2_0-1777273950259.png


This is the script on the record producer: 

ronro2_1-1777274019110.png

 




Is there something I need to do in the script as well? To call on the global application in some way @Rakesh_M ?




@ronro2 

I already shared a working solution above.

Did you get a chance to check that?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Hey @Ankur Bawiskar@Rakesh_M !

I tried the script you mentioned, and now I can see the attachment in the log, which is one of the requirements, but not in the banner. 

Look: 

ronro2_0-1777282781230.png

 

@ronro2 

the file should get attached to the record if you used the record producer script

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader