FlowHeater - The Data Import / Export Specialist
Welcome, Guest
Username: Password: Remember me
See also the general examples available, which may answer your question: Hello World 1 / 2 / 3 , format numbers as character strings , simple If-Then-Else , complex If-Then-ElseIf , filtering and grouping data , consolidate grouped values
  • Page:
  • 1


Import Bundle Items 5 years 10 months ago #2959

We have a customer that’s planning to offer bundled items on the site over the holidays. They did this last year but manually added the list of items to the import file.

I would like them to leave the bundle item on the file and let us (FH) remove/replace the bundle item and add the list of items from a SS we’ll maintain.

Order item qty
100 X101 2
100 X200 1
100 B101 2

During the import is it possible to replace the B101 (bundle item) identified by the ‘B’ with the list below

Bundle List:
B101 X300 1
B101 X400 2
B101 X500 3

SO, after the import the order will look like this.

Order item qty
100 X101 2
100 X200 1
100 X300 2
100 X400 4
100 X500 6

I can replace the one SKU no problem I just can not continue through the list.

Thanks for your continued support, JD

Please Log in or Create an account to join the conversation.

Import Bundle Items 5 years 9 months ago #2961

Hi JD,

It would be posible but it´s a bit tricky :-)

First you have to prepare a CSV file with all available bundle articles. For each bundle article you need one line.

The first column is the bundle article number and the second column ist the count how many articles the bundle article contains. The next colums are the containing article numbers followed by the quantity and so on.

For example:

To extent the current read text file for the containing bundle articles you need the GroupOut Heater . With this you just make as many line copies you need for the bundle article. The count are read with the help of the String Replace Heater from the bundle article CSV file .

Now you need a little script (see below) and the help if the .NET Script Heater to get dynamically the bundle article and the quantity or in case no bundle article the original values from the READ side.

Sounds quit strange but I guess you are able to understand the attached example I’ve made for you.

Important: Please take care about the input parameter sequence!

C# .Net Script to extend the bundle articles
// you may change here the bundle file name and the delimiter
string bundlefile = "bundles.txt";
char [] delimiter = { ',' };

public object DoWork()
  if (InValues.Length < 2)
    throw new Exception("min. 2 input parameter expected!");

  // read all lines from the bundle file
  string [] lines = File.ReadAllLines(bundlefile);  

  // get current group out position (AutoID Heater)
  int pos = (int)InValues[0].GetInt();

  // get current item
  string item = (string)InValues[1].GetString();

  // in case a third parameter is valid get the quantity
  int qty = -1;
  if (InValues.Length > 2)
    qty = (int)InValues[2].GetInt();

  // loop over all lines an search for a bundle article
  foreach (string line in lines)
    // split the line and compare the item number
    string [] columns = line.Split(delimiter);
    if (item.CompareTo(columns[0]) == 0)
      // bundle article found
      if (qty < 0)
	  return columns[pos * 2];
        return Convert.ToInt32(columns[1 + pos * 2]) * qty;

  // in case no bundle article return the original values
  if (qty < 0)
    return InValues[1].GetValue(); 
    return InValues[2].GetValue();

File Attachment:

File Name: replace-bu...ders.zip
File Size:3 KB
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.

Please Log in or Create an account to join the conversation.

Last edit: by FlowHeater-Team.

Import Bundle Items 5 years 9 months ago #2962

Thank you, this works great thanks for the example too that really helped. :)


Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.162 seconds

other Languages


FlowHeater Home

de en


Privacy Statement

Copyright © 2009-2022 by FlowHeater GmbH.
All rights reserved.

Follow us on

twitter  facebook


 de en