Skip to main content

I am trying to create a file, which is then shipped off to a SFTP site for upload into a SQL Server (via SSIS) system.

 

The file is created without issue, however there is an extra character appended to the row that causes the upload to fail. If I open the file manually, go the right of the very last characterand hit DELETE, then try uploading again, it works without issue. Mind you, the line feed or carriage return or whatever is getting appended makes sense with multiple rows of output, but the very last row of output should not contain this value.

 

Suggestions as to how to "clean" the last row of output?

 

%dw 1.0

%output application/csv separator="\t", header=false

---

[{

"Service Center Number": payload.External_ID_SCS__c when payload.External_ID_SCS__c != null otherwise flowVars.ASRId,

"Service Center Name": payload.Name,

"Service Center Address 1": payload.BillingStreet[0..29] when payload.BillingStreet != null and (sizeOf payload.BillingStreet) > 30 otherwise payload.BillingStreet,

"Service Center Address 2": null,

"Service Center City": payload.BillingCity,

"Service Center State": payload.BillingStateCode,

"Service Center Postal Code": payload.BillingPostalCode,

"Service Center Phone Number": payload.Phone,

"Service Center Contact Name": capitalize payload.Primary_Contact_Name__c when payload.Primary_Contact_Name__c != null otherwise null,

"Service Center Tax Rate 1": payload.Parts_Tax_Rate__c,

"Service Center Labor Rate": payload.ASR_Labor_Rate__c,

"Service Center Parts Markup Percentage": 0,

"Service Center Tax Rate 2": 0,

"Service Center Federal Tax ID": payload.SCS_Tax_ID__c,

"Service Center Default Payment Method Code": "WEX",

"Service Center Email Address": payload.Email__c,

"Entity Code": payload.SCS_Entity_Code__c,

"Vendor Number": payload.Account_ID__c

}]

2 answers
0/9000