You are currently viewing documentation for Linnworks Desktop, if you are looking for Linnworks.net documentation, click here.






Import/Export Evaluation expressions

Evaluation expressions allow you to overwrite data you are importing from the fulfilment company, or in case of data export – create new column with expression based output.

Things to know

  • The expressions are set in Default Value setting for each column.
  • The expression has to be surrounded by EVAL{expression}, for example
    EVAL{1+1}
  • The commands and functions are the same as in the macro engine expressions.
  • You can use the data in the exported/imported row in the expression. You must refer to a column name in the expression by surronding the column name with [{columnname}], for example

    EVAL{IIF[[{Country}] ="United Kingdom","Domestic","International"]}
  • If an expression is invalid the file will not be produced or imported at all, and you will receive an error during synchronization
  • To explicitly specify that the column value in the expression is a numeric value you must surround the name of the column with N[{columnname}], for example

    EVAL{IIF[N[{QuantityAvailable}]>0,”Yes”,”No”]}

 

Use case - Examples

Importing order status

Assuming the import file has column names: OrderId, Status, Tracking and Error

  • Order status – Problem: the fulfilment company outputs DONE instead of SHIPPED in the status column when the order is shipped. Solution: Use expression to replace DONE with SHIPPED.
    EVAL{IIF[[{Status}]="DONE","SHIPPED",[{Status}]]}
  • Order status – Problem: the fulfilment company does not provide order status. If the order is shipped it will be added to the file with the tracking number. Solution: If the order can have empty tracking number then you can just add SHIPPED to the default value. However if you want to process orders only if the tracking number is supplied in the status file, use expression.

    EVAL{IIF[[{Tracking}]<>"","SHIPPED","NOTRACKING"]}
  • Order Id – Problem: the fulfilment company adds REF- at the beginning of the order id. Solution: Use expression to remove REF-

    EVAL{replace[[{OrderId}],"REF-",""]}
  • Error – Problem: Fulfilment company does not change order status to ERROR if there is an problem, instead Error column is populated with the text. Solution: Use Expression to change status to ERROR if Error column is not empty
    EVAL{a:=IIF[[{Status}]="DONE","SHIPPED",[{Status}]]; IIF[[{Error}]="",a,"ERROR"]}

    note: here we have used two expressions in one, separated by ; In the first one we evaluated if DONE, then replace with SHIPPED as in the first example, and in the second one, if Error message is not empty, then replace it with ERROR.

Exporting Orders to fulfilment center

  • Add my account id column – Problem: Fulfilment company requires me to add account number in the flat file for every order. Solution: Add new column to export specification, leave it as CustomColumn, change output name AccountNo and specify your account number in the default value

  • Add AddressType column – Problem: Requirement to output International if the order is for outside of the UK and Domestic for UK.

    EVAL{IIF[[{Country}]="United Kingdom","DOMESTIC","INTERNATIONAL"]}
  • Fulfilment center/drop shipper knows my products under different SKUs – see Supplier (Drop shipper or fulfilment center) SKUs are different to yours in FTP flat file - available stock levels import from Fulfilment Warehouse/Drop shipper

Import stock levels

  • Fulfilment center/drop shipper knows my products under different SKUs – see Supplier (Drop shipper or fulfilment center) SKUs are different to yours in FTP flat file - available stock levels import from Fulfilment Warehouse/Drop shipper
  • Stock level – Problem: Drop shipper provides stock levels as Available or Not Available, instead of a number. Solution: Use Expression to evaluate if Available then output 5, else 0.
    EVAL{IIF[[{ProductAvailablilty}]="Available",5,0]}

    assuming there is a column ProductAvailablity in the file which contains the Available/NotAvailable indicator.