How to exclude products by import list
There are many ways by which you can exclude products by applying rules, either on import or export files. However, you can also exclude products dynamically by adding a subordinary import with a list of items you want excluded dynamically.
In this example we will use a Google Sheets file with a list of IDs we want excluded. Note that whenever you add or remove the IDs from that file, the changes will be reflected in the system, thus feeds.
The first step is to add import by going to Imports -> Add import. Once inside, select Google Sheets and add the name as well as the URL to your file. Make sure that your Google Sheet file is published properly so that the data can be collected by the system. You can check how to publish the file properly in this article - How do I use Google Docs for import?
NOTE: if your file contains only one column, make sure to scroll down and select the checkbox "File contains only one column. In our example it does, so we will select the box and go to Mapping.
In the mapping panel, make sure to map the column containing product IDs with the id parameter. If you do not see your file data here, it is likely that your file does not contain a column header. To make the file subordinary to your main import, make sure to also combine data by id in the upper right window.
Once that's done, your file should be linked with the following sign on the imports overview:
Next step it to assign a custom variable to the products from the list we've just imported. To do that, go to Rules of our newly imported file. Once there, follow the steps below:
- Create a new custom variable. For this example we will name it "Exclude_var"
- Create a new rule and use the following settings:
IF all elements
THEN Exclude_var set to value 1
The 1 value in this rule can actually be anything. It's only a value which we will use to grab the products by in the further steps.
Moving onto an export feed in which we want to exclude the products from the list, which are already assigned with a variable that helps identifying them, go to export's Rules and create the following rule:
IF Exclude_var text equal 1
THEN all elements exclude all
Click save and Adjust the settings will be applied. You have succesfully excluded the products from an import list. Any products that will be added/removed from the list will be reflected in the feed from now on.