How to replace exported value of a choice field in Scheduled Data Export?

Med99
Tera Contributor

Hi,

In a Scheduled Data Export on a table, I want to replace the exported values of a choice field (install_status) :

 

for example:

"In use" → Active

"Retired" → Decommissioned

 

I tried using a Pre-export script with row.setValue() or setDisplayValue(), but it doesn't change the exported CSV values.  Is there a way to override the display value in the export only,  Thanks!

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Med99 

that's not how it will work.

you will have to somehow handle this in post export script, get the attachment record sysId, get the csv file

Parse it and then manipulate and store it again

It's somewhat complex.

check these links

Scheduled Data Export-customized csv file 

Scheduled/Export file/records to attachment to a mid server folder 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Med99 

that's not how it will work.

you will have to somehow handle this in post export script, get the attachment record sysId, get the csv file

Parse it and then manipulate and store it again

It's somewhat complex.

check these links

Scheduled Data Export-customized csv file 

Scheduled/Export file/records to attachment to a mid server folder 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Hi, thanks  for your input.

I followed your suggestion by creating a post-export script that triggers a MID Server script include to open and modify the CSV file (attached to the ecc_agent_attachment table). However, I keep hitting the following error:

 

 
Unable to find the signature with the sys id [XYZ], for the table ecc_agent_attachment... CodeSigningException...

It seems like ServiceNow requires a digital signature (KMF Signature record) to manipulate files tied to ecc_agent_attachment for mid_script purposes.

Unfortunately, I can't bypass the MID Server export process because the client requires the files to be transferred via MID Server.

Have you ever had to deal with this KMF Signature restriction? Did you sign your script and/or attachment somehow, or was it handled differently in your case?

Thanks again

@Med99 

I haven't encountered any such issue in the past.

may be some security part is blocking the manipulation.

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