Dynamic data import / export

datenbank

simply more productive
Up to 10,000 records can be processed with the freeware version!
Welcome, Guest
Username: Password: Remember me
Welcome to the FlowHeater support forum.

Questions about using FlowHeater are answered here.

TOPIC: Excluding Field

Excluding Field 4 years 4 months ago #2240

  • Herbert Berkley
  • Herbert Berkley's Avatar
  • Offline
  • New Member
  • Posts: 15
I am using some code that creates a file name based on a field.. It also includes that field into the file being created. I use the unique field for each file but I don't want to throw it into the created file..

Here is my code..
public object DoWork()
{
if (InValues.Length != 2)
throw new Exception("2 Inputparameter expected!");

// get the TextFile Adapter from the WRITE side
TextFileAdapter adapter = (TextFileAdapter)AdapterWrite;

// Build the new filename using the InvoiceNumber = second input parameter
string filename = (string)InValues[1].GetString();
if (filename == null)
throw new Exception("not a valid invoice number!");

filename += ".txt"; // you can changes the ending by yourself

// set new file name on the WRITE side
adapter.Filename = filename;

// return the first input parameter for further processing
return InValues[0].GetValue();
}

I have attached an image file that shows the first number in the sequence, invoice number, that needs to be left out when generating each individual file.
Attachments:
The administrator has disabled public write access.

Re:Excluding Field 4 years 4 months ago #2241

  • FlowHeater-Team
  • FlowHeater-Team's Avatar
  • Offline
  • Administrator
  • Posts: 240
Hi Herbert,

You do not need a script for this anymore. With the help of Parameters this is quite simple.

You just need one String Append Heater to build the dynamic export file name and one Set Parameter Heater to set the Parameter "$Filename$" to this new value.
On the WRITE side you have to set the export file name to $Filename$ that’s all.

You can find a brief example in the attachment.

Attachment dynamic_filename_with_parameter.zip not found

Attachments:
Best wishes
Robert Stark

Did this answer your question? We would be grateful if you provide a brief comment as feedback. It may also help others who may have encountered a similar problem.
The administrator has disabled public write access.
Moderators: FlowHeater-Team
Time to create page: 0.075 seconds