Automations · Part 3

Command Reference

Every automation command, grouped by the job it does, with what goes in its two parameters. Use it to find the command for a step, and to check a name and its values before you save an automation.

Reading this page

  • Names are exact. Type a command as it is written here, capitals included. In Settings a name Spanner doesn't know shows salmon pink.
  • 1 and 2 are Parameter 1 and Parameter 2. A command with neither takes no values.
  • The selected document is the one a command works on. Commands about a planogram work on the selected planogram, and the Change commands on the selected object: a bay, fitting or point of sale. Select it by clicking it, or with Select By ID earlier in the automation.
  • Product commands change every product in the document, unless the command says otherwise.
  • A field is a product property, such as UPC, ID or Name, or a classification, by its name or by its number in the document's list, counting from 0.
  • Measurements are in microns: 1 mm is 1,000 and 1 m is 1,000,000. Change Dimension, Change Position and Move Shelf also take a measurement with its units, such as 50cm or 100mm.
  • Lists are separated by | unless the command says otherwise.
  • A sales code is a measure, an outlet, a period and a year joined by underscores, such as VAL_0_1_TY: value, the first outlet, Time1, this year. * stands for every outlet, period or year.
  • (2.5.1.2) marks a command or option that needs Spanner 2.5.1.2 or later, and likewise for other versions.
This guide is for Spanner 2.5.1.2 and later. The same descriptions, in shorter form, are shown in Spanner: under the boxes in Enter Automation Command, and when you hold the mouse over a command's name in Settings.

Document setup

The same changes the Document Editor makes; Document Setup explains each part.

CommandParametersWhat it does
Times1: Time1 weeks
2: Time2 weeks
Sets the two time periods. Time1 and Time2 set one each (1: the weeks).
Set Latest, Set Previous1: the nameHow the latest year and the year before are labelled.
Set Default Outlet, Set Default Channel1: name or numberThe outlet or channel used where a planogram has none of its own.
Add Outlet1: name
2: place, blank for the end
Adds an outlet, with no data yet.
Rename Outlet1: outlet
2: new name
Renames it.
Move Outlet To1: outlet
2: place from 0, or End
Moves it, with its data.
Delete Outlet1: outlet or channelDeletes it and its sales data.
Clear Outlet Sales Data (2.5.1.2)1: outlet or channelSets all its figures to zero and keeps it, as before importing a new period.
Add Classification1: name
2: place, optional
Adds a classification.
Rename Classification1: classification
2: new name
Renames it.
Move Classification To1: classification
2: place, or End
Moves it. Move Classification Up and Move Classification Down move it one place.
Delete Classification1: classificationDeletes it and its values.
Remove Empty ClassificationsDeletes classifications no product has a value in.
Add Default Classifications, Add Default Measures, Add Default Calculated Measures, Add Default MovementAdd your defaults from Settings that the document lacks. Calculated measures with the same code are updated.
Add Measure1: Code \ Short Description \ Long Description \ Hide \ Calculation \ Criteria \ Preset Value
2: a number format, optional, e.g. N0
Adds a measure, or changes the one with that code. Only Code and Short Description are needed.
Move Measure To, Delete Measure1: code or short description
2 (Move): place, or End
Moves it, or deletes it with its data.
Add Calculated Measure1: Code \ Group \ Description \ Type \ Calculation
2: a number format, optional
Adds one, or changes the one with that code. Codes start with a small c, e.g. cMARGIN; Type is Product Double, Product String, Position Double or Position String.
Move Calculated Measure To, Delete Calculated Measure (2.5.1.2)1: code
2 (Move): place, or End
Moves or deletes it.
CalculateWorks out every calculated measure again.
Set Movement (2.5.1.2)1: the rows, e.g. MOVE Outlet 1 TY|MOVE Channel 1 TYReplaces the movement rows. Each is a measure code, Outlet or Channel, 1 or 2 (the period) and TY or YA.
Case Rule, Minimum Days Cover, Desired Days Cover1: a planogram (name, number or ID), All, Document (2.5.1.2), or blank for the selected one
2: the value
Sets the stock rule. All sets every planogram and the document's default; Document sets only the default a new planogram starts with.
Set Substitution Scope (2.5.1.2)1: Planogram, Group, Department, Category, Sub-Category, Cluster, Region, Status or DocumentWhich planograms count as the range when judging whether substitutes are there.
Set Substitution Share (2.5.1.2)1: a number from 0 to 1How much substitution overlap is shared between two listed products.
Rename Substitute Data, Move Substitute Data To, Clear Substitute Data, Delete Substitute Data (2.5.1.2)1: the data set
2: new name, or place
Work on a substitution data set.
Apply Demand Model, Apply Space Model (2.5.1.0)1: a model's name or number in Settings; blank for the only one or the default; None to take it offGives the document a model saved in Settings.
Scale Document1: a numberMultiplies every measurement in the document by it.

Product codes

These change a field for every product. A calculated classification is left alone, as its formula would only put the values back.

CommandParametersWhat it does
Copy Product Strings1: from field
2: to field, or Matches (2.5.1.1)
Copies each product's value across. With Matches, the value is added to the product's other codes and nothing is replaced.
Concatenate1: fields, separated by spaces; put a name with a space in quotes, e.g. Brand "Pack Size"
2: to field
Joins the values with a space between them, leaving out blanks.
Set Text1: field
2: the text
Gives every product that value. Blank empties the field.
Clear1: field, or MatchesEmpties the field. With Matches, every product's other codes go.
Trim1: fieldTakes spaces off the start and end.
Left, Right1: field
2: how many characters to keep
Keeps the first, or last, characters.
Mid1: field
2: where to start, counting from 1, and how many, e.g. 3 5
Keeps that part.
Remove Characters1: field
2: how many and Start or End, e.g. 1 Start
Takes characters off the start or end.
Clean Web Text1: field, blank for NameTurns web codes such as & back into the characters they stand for.
Check Digit1: field, blank for UPC
2: 7 12, or blank for every code
Adds the barcode check digit to the end. With 7 12, only to codes of 7 or 12 digits.
UPC Length1: blank for 8/13 digits, or 13Writes every UPC in that form.
IRI2UPC1: field, blank for UPCTurns Circana (IRI) item codes into UPCs.
Code Products (2.5.1.0)1: Classification=Value, e.g. Status=Archive
2: the test, as Delete Products takes it, joined by |, e.g. VAL_*_*_*|==0
Sets the classification for the products that pass the test. A blank value clears it.
Copy Table Column1: the column's letter in the table showing, e.g. K or AB
2: to field
Copies a product table's column on the Reports tab into a field.
Calculate Classification Sizes1: the size classification
2: the rules, e.g. L=1000ml Kg=1000g
Rewrites sizes in one unit, so 1.5L becomes 1500ml.
Calculate Products Sizes1: the size classification
2: a pack count classification, optional
Sets each product's size from the numbers in the classification, times the pack count: 6x330ml gives 1,980.

Products

CommandParametersWhat it does
Merge Products1: the product to keep, by ID, UPC or name
2: the product to merge into it
Merges the second product into the first: its positions become the first product's.
Merge Many Products1: the key: UPC or a classification
2: options (2.5.1.0): Pad14 and ID
Merges every group of products that share a key. Building a Product Library explains the options.
Delete Products1: a classification, a property such as HasUnitDimensions, or a sales code
2: the value, or a comparison such as <30 or any>=30
Deletes the products that pass. DIST_*_1_TY with <30 deletes products under 30 in every outlet.
Remove Unused ProductsDeletes every product with no position on any planogram.
Colour Products1: a colour, or blankGives every product that colour, or with blank, the average colour of its picture.
Other Merch Positions1: words in the product's name, blank for all
2: planogram names, or <SELECTEDPLANOGRAM>
For products with no Other pack yet, works one out from how they are faced on those planograms.
Load Images1: Missing, Positions Missing, Reload, Reload Positions, Product by Product, Positions Product by Product, or ClearLoads product pictures, as View › Images does. Positions means only products on a planogram.
Images1: On, Off, or blank to switchShows or hides product pictures.

Sales data

CommandParametersWhat it does
Load Sales Data1: a sales data interface's name
2: optional, parts separated by \: add, and Their Name»Our Name for an outlet
Runs the import, as Interface › Sales Data Interfaces does (see Importing Sales Data). If the interface's file isn't there, Spanner asks for it. add adds products the file has and the document hasn't; Retailer A Total»Retailer A puts the file's outlet into the document's.
Scale Measure1: a measure code, or a sales code
2: a number
Multiplies the figures by it, e.g. 0.001 to turn units into thousands.
Set Outlet, Set Channel1: the nameThe selected planogram's outlet or channel.
Refresh Navigator Sales DataBrings the sales figures in the navigator up to date.

To empty an outlet before an import, use Clear Outlet Sales Data.

Planograms and fixtures

CommandParametersWhat it does
Add PlanogramAdds an empty planogram and selects it.
Add Preset Planogram (2.5.1.2)1: a preset planogram's name or number, blank for the firstAdds a planogram from a preset, as Edit › Add › Preset Planogram does. Part 4 covers presets.
Add Bay, Add Shelf, Add Bar, Add Pegboard, Add Pegboard Multi, Add Chest, Add Curved Shelf, Add Table, Add Pallet, Add Point of Sale1: the preset's name or number, blank for the firstAdds that preset fixture from Settings to the selected planogram, and selects it.
Change Dimension1: Height, Width, Depth, or another, such as Base Height, Thickness, Notch Separation, MaxMerchHeight
2: microns, or with units
Changes the selected object's size.
Change Position1: X, Y, Z or Top of Fitting
2: microns, or with units
Moves the selected object.
Change Angle1: Angle Down (or Slope), Angle Right, Merchandise Angle or Arm Angle
2: the angle times 100, e.g. 1500 for 15°
Tilts or turns the selected object.
Change Colour (2.5.1.2)1: Colour, Border Colour, Base Colour, Base Border Colour, Riser Colour or Riser Border Colour
2: a colour name such as Silver, or #AARRGGBB
Colours the selected bay, fitting or point of sale. Base colours are a bay's; riser colours a shelf's.
Change Flow1: Left to Right, Right to Left, Spread Even, Facings or ManualHow positions are placed along the selected fitting.
Change Z Flow1: Front to Back, Back to Front, Spread Even or FacingsThe same, front to back, in a chest.
Change Leg Display1: None, Block, Sides or LegsHow a display table's legs are drawn.
Change Obstructs1: Obstruct, Not-Obstruct, or blank to switchWhether the selected point of sale pushes positions aside.
Change Position Cover1: the valueThe selected fitting's position cover.
Change Txt1: the textThe words on the selected point of sale.
Move Shelf, Move Fitting1: Up, Down, Lowest, or a height with units, e.g. 100mmMoves the selected shelf or fitting a notch, to the lowest free notch, or to that height.
Target Capacity1: the stock to hold, e.g. 1.25 * CaseCount > 1 (a space before the *)
2: LinearFacings (blank) or MaxBack
Sets each position's facings on the selected planogram to hold that much: here 1.25 cases, for products with more than one unit to a case.
Image String1: the side's number
2: the picture, as text
Puts a picture on a side of the selected object. Written by Decode to Automation Code.
Rotation1: X in microns and the angle in degrees, e.g. 3000000 90
2: the X and Z shift in microns
Adds a turn to the selected planogram, for a run of bays that goes round a corner.
Viewpoint1: the camera's X, Y and Z in microns
2: the direction it looks, X, Y and Z, and the field of view in degrees
Adds a 3D viewpoint to the selected planogram.
FSDUFor a free-standing display unit: shapes the 3D sides of the point of sale at each end of the selected planogram to the slope in their side pictures.

To bring fixtures in from another file, see Import Fixture and Import Planograms.

Selecting and viewing

These change only what you see or what is selected, never the document's data.

CommandParametersWhat it does
Select Planogram1: name, First, Last, or a number from 0Selects the planogram, so the work area shows it.
Select1: Planogram, Product, Bay, Fitting, Position or Point of Sale
2: First, Last, a number, or an ID, UPC or name; or Selected Position or Selected Fitting
Selects one. With Selected Position, a Bay or Fitting is the one the selected position is on; with Selected Fitting, the bay it is in.
Select By ID1: the ID of a planogram, product, bay, fitting, position or point of saleSelects it.
Select Bay1: the bay's numberSelects that bay on the selected planogram.
Deselect AllClears the selection.
Set Comparison Planogram1: name, or blank to stopThe planogram the Compare tab compares the selected one with.
Set Product Filter1: a classification
2: values; ≠ in front leaves them out; blank takes the classification out of the filter
Sets the product filter below the menu bar.
Set Planogram Filter1: Group, Department, Category, Sub-Category, Cluster, Region, Status or Planogram
2: as above
Sets the planogram filter.
Clear Filters1: Product, Planogram, or blank for bothClears them.
View1: Fit All, Fit Height or Fit Width
2: blank or 2D for the Front View, 3D for the 3D View
Shows the selected planogram on that tab, fitted to the screen.
Visual Render1: Hardware or Software
2: seconds, with Hardware
How 3D is drawn. With a number of seconds, Spanner goes back to Software after that time.
Clear 3D1: blank for the selected planogram, Document for allFrees the memory the 3D model takes; it is built again when next shown.
Undo, Redo1: how many
2: a pause between each, in milliseconds
Undoes or redoes that many steps, as Edit › Undo does.

Files

Give files and folders by their full path. A path can start %userprofile%, for your own user folder, so the same automation works for colleagues.

CommandParametersWhat it does
Add DocumentStarts a new document and selects it, as the New Document button does.
Open Document1: a Spanner document or PSA
2: for a PSA, Convert, or blank
Opens it and selects it. Convert adds your default classifications, measures and data format, and keeps the retailer's codes as Retailer ID and Retailer UPC.
Open PLNX1: a Spaceman .plnx fileOpens it as a new document.
Save Document1: blank for its own file, or a full path to save asSaves the selected document.
Save Image1: the .png file
2: High and, on the 3D View, Shading, separated by a space
Saves a picture of the selected planogram from the tab showing, with a clear background.
Export PPT, Export PDF1: an export template's name, then optionally | and planogram names
2: the file to write
Exports, as File › Export PPT does. With no names, every planogram.
Export PSAs1: a folderWrites each planogram to its own .psa file, named after it.
Import Fixture1: a Spanner documentAdds the bays, fittings and point of sale of its first planogram, without products, as a new planogram.
Import Planograms1: a Spanner document
2: planogram names
Copies those planograms, with their products, into the selected document.
Saving and exporting can't be undone, and a command in an automation writes over a file of the same name without asking. Use a new name, or a folder kept for the purpose.

Libraries and settings

CommandParametersWhat it does
Product Library1: a product library interface's name
2: ImportAll, ImportMatched, ExportAll, ExportMatched, ExportNew, ExportModified, ExportFillGaps (2.5.1.1), or ExportFiltered (2.5.1.0), which can be followed by :Classification=Value1,Value2
Does what the buttons in the product library window do. Using a Product Library explains each.
Product Library Get All1: the interface's name
2: a filter, optional: Column=Value1,Value2;Column2=Value3
Brings every product in the library into the document, or only those that pass the filter. The filter uses the library's own column names.
Load Settings1: a settings file
2: Add, or blank to replace
Adds the file's settings to yours, or replaces yours with them. Settings can't be undone.
Get MCP Sidecar PathShows, and copies, where Spanner's connector for AI apps is, for setting one up. See Using Spanner with AI apps.

Loops and conditions

A saved automation can repeat commands, or skip them, with these. They work only in an automation run from the menu, so Enter Automation Command doesn't list them. Most automations never need them: a straight list is easier to follow and to mend.

CommandParametersWhat it does
Skip1: Start, End, Last, a number (1 is the next command, -2 two back), or the name of a command in the automationCarries on from there. With a name, from the first command of that name.
Int1: a variable's number, from 0
2: a whole number; +n or -n to add or take away; ++ or --; or Planograms Count, Bays Count, Fittings Count or Points of Sale Count
Sets a counter. The counts are the document's planograms, or the selected planogram's bays, fittings or point of sale. Before 2.5.1.2, +n and -n set the counter to n.
Equals, Not Equals, Less Than, More Than1 and 2: the numbers of two variablesCompares them, for the If or If Not that follows. To compare with a fixed number, put it in a variable first.
If, If Not1: Skip
2: the name of a command in the automation
Goes to the first command of that name when the last comparison was true (If) or false (If Not), and otherwise carries on.

For example, to add four bays from the first preset:

ActionParameter 1Parameter 2
Int00
Int14
Add Bay
Int0++
Less Than01
IfSkipAdd Bay
  • Set every variable at the start. Variables keep their values from one automation to the next.
  • A command can't take a variable as its value, so loops suit commands that add something or act on what is selected.
  • A loop that never ends stops after 10,000 steps, with a message.

Where else commands run

  • Sales data interfaces. In an interface's custom commands, pre: or post: in front of a command's name runs it before or after the import, with the custom command's two values as its parameters: post:Calculate works the calculated measures out again after each import.
  • Preset planograms are saved as commands. Part 4 covers them, and turning a planogram into commands.
  • Common Custom Commands runs a command per button. See Part 2.
  • Spanner AI uses these commands for many of the changes you ask for. See Part 5.
File › Open Planogram Automation File is something else, despite its name. It builds a planogram from a planogram design file in JSON or CSV, and is set up in Settings under Planogram Automation Files. It doesn't use automation commands.

Not sure which commands you need?

Tell us the job and we will write the automation with you.

Email us Book a Demo