Import set-Ensure mandatory fields are filled in excel sheet

G Balaji
Kilo Guru

Hi,

We're upoading data to SNOW custom table through import set staging tables from excel file. 

We wanted to make sure values are available for all mandatory fields in the excel file before data gets inserted into SNOW table. If a field value is missing in excel file, an error message should be shown to end-user and record shouldn't be inserted into our custom table.

How to implement this?

1 ACCEPTED SOLUTION

Try using source.your_field_name_in_source.

View solution in original post

9 REPLIES 9

Ajaykumar1
Tera Guru

Hi Balaji,

The Enforce mandatory fields option on a Transform Map allows enforcement of mandatory fields.

Enforce Mandatory Fields will solve your issue.

Mark If Correct/Helpful if you found my answer correct.

Regards,
Ajay

 

Thanks Ajay for the response.

I tried using it but it didn't resolve the issue. 

Hi Balaji,

Write a onBefore transform map script :

if('source.mandator_field_name1' == '' || 'source.mandator_field_name2' == '' && action == 'insert')
{

    ignore = true;
    gs.log("Mandatory fields empty : Record Insertion skipped");

}

Regards,
Ajay

Hi Ajay,

 

Thanks for the response, I tried this script like you suggested but it didn't work out,

if(u_st_account_master.u_sbu == '' && action == 'insert')
{

ignore = true;
gs.log("Mandatory fields empty : Record Insertion skipped");

}