How To

Step by Step Guide to an Inventory Template

Example: Adding a business rule referencing a custom header

 
  • For this example, lets say that the file that you are uploading has a column/ called "INSTOCK", and if INSTOCK is 1 you want to add a label to the inventory item.  
  • Lets also assume that your upload file is a text file and not xml.

 

Step 1: Create a New Header


  1. Navigate to Inventory > Product Mapping > Define File Headers
  2. Click Add Header
  3. Enter the header name "INSTOCK" and click add

Step 2: Create the rule


  1. Navigate to  Inventory > Product Mapping > Business Rules
     
  2. Click New Business Rule/For Flat File.
     
  3. This sets the rule context to your flat file headers defined on step 1.1.  The 'tags' that you can use are therefore your headers.  They are referenced with a '$' followed by the header name.
     
  4. Give the rule a name and optional description.
     
  5. For the expression enter: 

    IF($instock > 0, "InStock", "-InStock")
      

    This expression states: If my instock header is greater than 0, then submit the text "InStock".  If it is 0 or less, submit the text "-InStock".
     
  6. This rule will be available on any flat file inventory template.

Step 3: Create a template and Reference the Business Rule


  1. Navigate to  Inventory > Product Mapping > Templates.
     
  2. Click Add Template.
     
  3. For this example, we'll assume that except for our custom header/field INSTOCK, most of your fields match up with the ChannelAdvisor upload fields with the exception of option 1.  This will pre-map the fields 1:1 for you.  If most of your fields are custom, choose option 3.
     
  4. Add a name to the template.
     
  5. Scroll down the template until you find the Labels field.
     
  6. Change the source to "business rule" and select the rule that you created in step 2.
     
  7. Scroll down to the bottom of the page and click Save.

Step 4: Using the template on an upload


  1. Navigate to Inventory > Upload a File.
     
  2. Select the file with your INSTOCK header.
     
  3. Select the new template.
     
  4. Click submit

When we process the file, the first thing we do is 'transform' the file using the mappings defined in the template.  In this example, when we get to the labels field, we will evaluate the business rule.  If INSTOCK is greater than 0, we will submit "InStock" thus applying a label.  Otherwise, we submit "-InStock" which will remove the label from the sku.

 

Example: Adding a business rule referencing a custom header

 
  • For this example, lets say that the file that you are uploading has a column/ called "INSTOCK", and if INSTOCK is 1 you want to add a label to the inventory item.  
  • Lets also assume that your upload file is a text file and not xml.

 

Step 1: Create a New Header


  1. Navigate to Inventory > Product Mapping > Define File Headers
  2. Click Add Header
  3. Enter the header name "INSTOCK" and click add

Step 2: Create the rule


  1. Navigate to  Inventory > Product Mapping > Business Rules
     
  2. Click New Business Rule/For Flat File.
     
  3. This sets the rule context to your flat file headers defined on step 1.1.  The 'tags' that you can use are therefore your headers.  They are referenced with a '$' followed by the header name.
     
  4. Give the rule a name and optional description.
     
  5. For the expression enter: 

    IF($instock > 0, "InStock", "-InStock")
      

    This expression states: If my instock header is greater than 0, then submit the text "InStock".  If it is 0 or less, submit the text "-InStock".
     
  6. This rule will be available on any flat file inventory template.

Step 3: Create a template and Reference the Business Rule


  1. Navigate to  Inventory > Product Mapping > Templates.
     
  2. Click Add Template.
     
  3. For this example, we'll assume that except for our custom header/field INSTOCK, most of your fields match up with the ChannelAdvisor upload fields with the exception of option 1.  This will pre-map the fields 1:1 for you.  If most of your fields are custom, choose option 3.
     
  4. Add a name to the template.
     
  5. Scroll down the template until you find the Labels field.
     
  6. Change the source to "business rule" and select the rule that you created in step 2.
     
  7. Scroll down to the bottom of the page and click Save.

Step 4: Using the template on an upload


  1. Navigate to Inventory > Upload a File.
     
  2. Select the file with your INSTOCK header.
     
  3. Select the new template.
     
  4. Click submit

When we process the file, the first thing we do is 'transform' the file using the mappings defined in the template.  In this example, when we get to the labels field, we will evaluate the business rule.  If INSTOCK is greater than 0, we will submit "InStock" thus applying a label.  Otherwise, we submit "-InStock" which will remove the label from the sku.

 
0
Your rating: None
0
Your rating: None