When using an import set, how to execute a variable using the file name as a key.

Komazawa Akane
Tera Contributor

I would like to sort files using business rules using file names as keys. Could you please advise .

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Komazawa Akane 

your question and the question content is different

what's your business requirement?

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

Thank you for your  reply.
I use an import set to populate a table with data.
So, I  am going to use business rules to specify the imported files and set unique actions.
For example, if the name of a file imported with an import set contains the characters Win, add the string to the target table. Is it possible to do something like this?

@Komazawa Akane 

you can handle how data gets transferred to target table using field map and transform script (onBefore)

what did you start with and where are you stuck?

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

Aniket Bhanse
Tera Guru

@Komazawa Akane 
As per your above explanation, it seems like you want to evaluate the File Name and then run your transform maps to populate the data in your table.

This is possible using Scheduled Data Import.

You have an option in the Scheduled Data Import called as "Execute Pre-import Script" where you can check the attachment attached to the Data source and check the File name. 

 

Please let me know if this response helps you in any way and mark it helpful.

 

Thanks