✌ V5 Feature Compilation

[JScript] method: JSON.parse()


Example Uses:
Web Services that have JSON output … http://openweathermap.org/api
JSON data stored in SambaPOS Database

[.NET] method: xml.Parse()

Method exposed to scripting engine

var weather=xml.Parse(allxml);
return weather.Temperature.Value + nL + weather.SkyConditions.Value + nL + weather.Wind.Value;

Debugger for scripts

Local Settings > Scripting

Download Free Visual Studio …

Temporarily add keyword debugger inside script code.
When debugger keyword is found, the VS JIT Debugger will launch so we can step through code line-by-line.

KPI Tile example

Demonstrates various new features using JScript and Helper Functions:


Tile Template:



Select count(*) from Tickets where Date > '{Start}' and Date < '{End}'


function ticketCount()
   var thisMonthTickets = sql.Query('@@TicketCount').ThisMonth.First;
   var previousMonthTickets = sql.Query('@@TicketCount').PreviousMonth.First;
   var thisAvg = Math.round(thisMonthTickets / dt.ThisMonth.Days);
   var prevAvg = Math.round(previousMonthTickets / dt.PreviousMonth.Days);
   var inc = thisAvg > prevAvg;
   var sym = inc ? tag.Color('green').Sym('▲') : tag.Color('red').Sym('▼');
   var header = tag.Add(sym).Add(thisMonthTickets).Add('Tickets').Get();
   var footer = tag.Add(dt.PreviousMonth.MonthName).Add(previousMonthTickets).Get('tickets');
   var todayTickets = sql.Query('@@TicketCount').Today.First;
   var footer2a = (prevAvg - todayTickets) + ' more tickets needed';
   var footer2b = (todayTickets - prevAvg) + ' tickets ahead. Keep going';
   var footer2 = inc ? footer2b : footer2a;
   footer = tag.Add(footer).Linebreak().Add(footer2).Get();
   return tag.Size(30).Add(header).Linebreak().Linebreak().Size(14,footer);

<sparkline> Tag

Generates simple graphics inside Tiles.

<sparkline [type] [width]>1,2,3,4,5</sparkline>

[type] can be bar, line, or area

<block> Tag

Used to fine-tune Tile Layouts.

When used as the root tag, it will reset the Tile Margin to zero.
We can also set the following values:

<block [margin] [color] [alignment] [width]>


[margin] is comma-separated values for: Left,Top,Right,Bottom
[color] can be specified as one of: Red, #FF0000, #55FF0000
[alignment] can be one of: left, right, center ,justified
[width] sets the block width in pixels


<block 5,2,9,22 #FF0000 left 250>

Custom Keyboard improvements

CSV support using quoted values:


Last 8 will be a backspace as it not surrounded with double quotes.

New shortcuts:

"<ds>"          Decimal Separator.
"<enter>"       Enter key
"<space>"       Space key
"<backspace>"   Backspace key
"<tab>"         Tab key

Setting text values in the Editor:

"Accept<linebreak/>This=Yes"|"Don't Accept=No"

Clicking “Accept This” button will send “Yes” text into the editor.

Automation Command support:

"Display<linebreak/>Calculator=Execute App:Calculator"

Clicking “Display Calculator” button will execute Execute App Automation Command with Calculator as the Command Value.

POS Numberpad converted to Custom Keyboard

Change it through Menu Category Custom Keyboard setting.

Old Alpha Button Values setting for Menu Category will appear as Custom Keyboard. In the DB it appears as AlphaButtonValues.

Now we have more space to place Automation Command buttons since custom keyboards supports executing automation commands.

Multiple Menu Functionality

Change Screen Menu action implemented for changing menu inside tickets.

Display in Report Explorer setting added to custom reports to un-list widget or print only reports from reports module.

{ENTITY ACCOUNT NAME:<entity type>} Tag

Retrieves the Account Name of an Entity.

Batch Entity Creation screen improvements

Batch adding / editing / deleting entities
Displaying custom fields properly
Batch creating entities with custom fields by CSV format

Markup language for data transfer, import, export

Example, for Batch Create Products dialog:

- Name: Coke
  GroupCode: Drink
  - Name: Bottle
    Price: 1.00
  - Name: Can
    Price: 1.50
  - Name: TagName
    Value: TagValue
- Name: Fanta
  GroupCode: Drink
  - Name: Can
    Price: 1.50


Caption fields on Widgets now include support for Expressions and Tags


Expression reading Program Setting (custom):

[=('{SETTING:WPopen}'=='1' ? 'Open' : 'Closed')]

Built-in Program Setting:


Script Handler Call:


Entity Button Widget also supports Entity-related Tags, such as:


Table Entities showing Entity State with Caption:

<bold>{ENTITY NAME}</bold><linebreak/>{ENTITY STATE:Status}

Table Entity showing Entity Custom Data with Caption:

<bold>{ENTITY NAME}</bold><linebreak/>Server:{ENTITY DATA:Server}

Customer Entity showing Account Balance with Caption:

<bold>{ENTITY NAME}</bold><linebreak/>{ENTITY BALANCE}

Script: ProgramSettings
Handler: settings
Example: {CALL:settings.getSetting('{SETTING:WPopen}')}

function getSetting (settingname) {
  return tag.Get(settingname);

Script: DBQuery
Handler: db
Example: {CALL:db.getSetting('WPopen')}

function getSetting(settingname) {
  var qry = "SELECT [Value] FROM [ProgramSettingValues] WHERE [Name]='"+settingname+"'";
  //var r1 = sql.Exec(qry,dt.Day());
  var r2 = sql.Query(qry).First;
  return r2[0];


Entity Button Widget supports Automation Command

By default, clicking an Entity Button will select the Entity and take you to the POS screen. If you supply an Automation Command, this will prevent the POS screen from showing automatically.


WorkPeriod is <b>[=('{ENTITY STATE:WPStatus}'=='WPopen' ? 'OPEN' : 'CLOSED')]</b><linebreak/>Click here to [=('{ENTITY STATE:WPStatus}'=='WPopen' ? 'Close' : 'Open')] the WorkPeriod

1 Like


Navigation Tiles will contain Tile Cache setting. When we set a Cache Lifetime in minutes it won’t refresh before Cache expires. For example we can set Weather tile Cache Lifetime 30 minutes so it won’t access API for 30 minutes.




New Rule creation automatically adds Default Mapping!

End Work Period Action (disabled)

Start Work Period Action (disabled)

1 Like



  • Ticket Lister will remember selected items while refreshing.
  • Automation Commands for navigations will accept module name and parameter values so we don’t need to setup a rule for common navigation needs.
  • Possible Module Parameters (for example entity screen names for Entity Module) can be selected through combobox.
  • Automation Command’s execute command navigation setting removed as it is not needed with new settings. Leave Navigation module setting blank to execute it as an automation command.
  • Combox selection for navigation tile symbols.
  • <block> tag will accept text alignment and width. If we set a text alignment we should also set width. new syntax is <block margin color alignment width>. Accepted values are left,right,center,justified
  • symbol font setup issue fixed.
  • work period start, end actions enabled.
  • Changing menu items through price list, product tag editor or menu item editor will reset terminal’s cache.
  • I found somewhere manager creates a fake user, makes a gift and deletes him lol. Prevented.
  • JScript sql helper received Join() function to obtain SQL result as a comma delimited string. Will be very useful to build <sparkline> graphs.
  • Setting values more than %90 for category column width disallowed.


Label widget implemented.

Green time display is a label widget that uses double <block> trick to display multi color layout.


Editor widget implemented.

That widget literally makes SambaPOS a development tool. That screen demonstrates a summary calculator.



Automation Commands if configured to use Automation Command Executed event and Navigate Module action will now check if Confirmation option is enabled in the Automation Command.

1 Like

You can now use the Tag Order Action with Free Tagging to write the Tag Description and Price.


Action Display Ticket List has filters for Entity Type and Entity:

Ticket List displays first 30 characters of Ticket Note:

1 Like


Load Ticket Action can load a Ticket by Ticket Tag or Ticket State

Custom Product Tags may have default values.

If you want to setup a default value that contains comma character you can use double quotes to escape commas. For example, if your decimal separator is a comma (,) this will be useful:

Discount=No,"VIP Rate=1,10"

Existing products will not receive default values, but new products will get default values.

  • Use the Product Tag Editor to edit multiple Tags… Select a few cells, edit value, and it will ask if you want to update all values.

All action Parameters will be trimmed of whitespace

This is to ensure a user does not accidentally add spaces while copy & pasting values.

Grouping in Tickets

Use Update Order Group Action to group orders as needed.

Group Tag: the name of the group

Key: another group identifier. It is not displayed on screen. You can use it to have multiple groups with same name.

Format: {0} is a placeholder for Group Name. You can use format parameter to change size, color, font of the group bar.

Background Color: is the background color for the group bar so you may have multiple groups with different colors.

Group Printing

Notice there are two Menu 1’s printed separately because different Key parameters used in action.


PS: [ORDERS:GROUP TAG=*] is a special template section for orders that have a group tag.

<L00>Ticket No:{TICKET NO}
<J10>Total:|{TICKET TOTAL}







Update Application Subtitle Action changes

  • Update Application Subtitle Action accepts height setting.
  • Update Application Subtitle Action accepts Tag formatting so foreground and font settings deleted.

  • Create Entity Action will break if another entity with same name exists.
  • {ORDER INDEX} and {INDEX TOTAL} tags implemented to print 1/5 … 4/5, 5/x counters next to orders (labels)
  • User Role specific navigation layouts supported by manually creating empty tiles.txt file with role name (all lowercase). For example if you have admin_tiles.txt file users that have admin role will use that file to store layout. If there is no role specific file tiles.txt file used. We can create an auto configurator later to create / delete that file.
  • Auto Configuration Repository URL’s setting moved from Program Settings > Maintenance to Local Settings > Online Services.
  • Ask Question Action accepts Transparent color to change transparency of question dialog.


Implemented CURRENTMENU setting. You can read it with {:CURRENTMENU} tag.

JS API Objects added:




PS: [param] indicates an optional parameter but you can’t skip parameters. If you want to set third optional parameter you should also set values for former optional parameters.

Not sure what else is new … please edit the post to include other new features… I unlocked the Topic to allow editing.

1 Like

Ask Question transparency is great for full screen messages/instructions, a few of my examples below



{RANDOM:L:C} tag accepts characters used to generate random strings


<length> : Length of generated string. Default 8.
<chars>  : Characters used to generate string. Default ABCDEFGHJKLMNPQRSTUVWZYZ123456789

Invalid <img> tags will not crash SambaPOS. It will display an error message inside content.

Warning displayed if rule constraint has unmatching parenthesis structure. (eg [:Variable} )

Automation command’s Image setting moved to Navigation page and used to define background images for Tiles.

Button heights automatically calculated when Menu Item Button Height set as 0. Buttons will fully expand to available size.

Browser Printer - new Add-on Module

The Browser Printer can be used to display printing content in Internet Explorer which will be useful for building Customer Display Screens. After enabling the Add-on Module we can set a printer type as Custom Printer > Browser Printer.

  • Enable Custom Printers module.
  • Restart SambaPOS.
  • Create a new printer.
  • Set printer type as Custom Printer.
  • Edit settings and enter a file name where SambaPOS can write. If left empty [Documents]\SambaPOS5\CustomerDisplay.html will be used.
  • Enable kiosk mode in Internet Explorer if you want full screen display.
  • Setup a printer template.
  • Setup a print job and map printer and template.

Now you can use Execute Print Job action to send data to Browser Window. This printer will not process any printer template formatting tags such as <J>, <L>. Instead, use html tags to format your output.

Use this on top of the HTML template if IE blocks page content.

<!doctype html>
<!-- saved from url=(0014)about:internet -->

On future versions we plan to have +2 monitor support for a specific device we have. For now only secondary monitor is supported.



Update Program Setting Action contains a new Update Type: Delete

The Delete update type removes a setting from the database.

Menu Numberpad Height % can be changed per-Category

Menu Item buttons supports displaying values for reporting tags and global printing tags

For example: {SETTING:X}, {CALL:X}

New tag {REPORT INVENTORY:<inventory item name>:<warehouse name>}

Other than reporting we can also use this tag to display inventory level on specific menu item buttons or test specific inventory levels on the fly.

:warning: IMPORTANT: Inventory level calculation needs to process all Tickets and all Inventory Transactions created in current work period (for each inventory item). So to avoid unnecessary network traffic try to use this feature for only a few menu items that really have mission critical meaning.

{WORKPERIOD ID}, {FIRST TICKET NO}, {LAST TICKET NO} report tags implemented

These tags can be useful for creating more complete Work Period Reports for accounting and auditing purposes.

Order State Formatting

  • Display Format is used while displaying product names
  • Quantity Format used while displaying quantities
  • Price Format used while displaying prices
  • {0} indicates placeholder for formatted value


<color #FF888888><italic>{0}</italic></color>

:warning: When you override Submitted state format you should also set a display format for Gift & Void states otherwise they’ll appear in submitted color as these orders already have that state.

Header setting added to Menu Categories

Now you can individually change how categories appear without changing category name. You can also choose to display Text only, Image only, or both.

[ORDERS:INDEX:x] section tag added

Useful to change formatting for orders that have a specific index. For example, in this Ticket, the Order at Index 3 is displayed on the Customer Display in bold red…


<div id="orderline" style="width:99%; font-size:16px; border-top:solid 1px #BBB; padding:3px;">
  <div id="prodimg" style="width:15%; display:inline-block; vertical-align:middle"><img src="D:\Programs\POS\images\[='{ITEM TAG:ProdImage}' !='' ? '{ITEM TAG:ProdImage}' : 'znoimage-th.jpg']">&nbsp;</div>
  <div id="prodqty" style="width:5%; display:inline-block; vertical-align:middle">{QUANTITY}</div>
  <div id="prodname" style="width:45%; display:inline-block; overflow:hidden; vertical-align:middle;color:#FF0000"><b>{NAME}</b></div>
  <div id="prodprice" style="width:13%; display:inline-block; text-align:right; vertical-align:middle">{PRICE}</div>
  <div id="prodamount" style="width:15%; display:inline-block; text-align:right; vertical-align:middle">{TOTAL AMOUNT}</div>
<div style="width:99%; text-align:left; font-size:10px;">{ORDER TAGS}</div>

<div id="orderline" style="width:99%; font-size:16px; border-top:solid 1px #BBB; padding:3px;">
  <div id="prodimg" style="width:15%; display:inline-block; vertical-align:middle"><img src="D:\Programs\POS\images\[='{ITEM TAG:ProdImage}' !='' ? '{ITEM TAG:ProdImage}' : 'znoimage-th.jpg']">&nbsp;</div>
  <div id="prodqty" style="width:5%; display:inline-block; vertical-align:middle">{QUANTITY}</div>
  <div id="prodname" style="width:45%; display:inline-block; overflow:hidden; vertical-align:middle">{NAME}</div>
  <div id="prodprice" style="width:13%; display:inline-block; text-align:right; vertical-align:middle">{PRICE}</div>
  <div id="prodamount" style="width:15%; display:inline-block; text-align:right; vertical-align:middle">{TOTAL AMOUNT}</div>
<div style="width:99%; text-align:left; font-size:10px;">{ORDER TAGS}</div>

Last Update Time Desc sorting option added to printer templates

An example use of this sorting option is a Customer Display Template where you want the most recent order to appear at the top, and the earliest order to appear at the bottom.

Automatic sizing menu buttons optimized

Generates better button layouts while searching products on POS screen.

State settings refresh when user logs in

For example, {:ISCURRENTWORKPERIODOPEN} will be refreshed on User Login.



Create Account Transaction Document Action has new parameter: Date

Default will use current Date/Time, but you can force a Date/Time in the Past or Future via this parameter.

One example usage is when you want your Reporting to show Employee Wage Payments on certain dates, but today is not that date.


  • Scrolling features improved for Touch Screens
  • Regular Expression validation added for Entity custom fields.
  • Entity Custom Field query fields will accept {CALL:X} function to supply values via JScript.
  • Menu & Category editing grid replaced with new grid. You can select multiple cells to edit multiple values at once.
  • Validation & Query features enabled for Batch Entity editor.
  • Google Calendar API add-on module added.
  • [ORDER TAGS GROUP|] section added to printer templates for grouping order tags on printing.
  • Add limit payment processor supports limiting by ticket amount.
  • You can enable visual printing setting for custom reports to print reports as seen exactly on the screen. Will be useful to print reports that contains grids.
1 Like


You’ll be able to format / validate free tags by using regular expressions. In this example free tag entry area will only accept upper case letters.