# Portion Selection With Keyboard?

**URL:** <https://forum.sambapos.com/t/portion-selection-with-keyboard/8908>\
**Category:** Version 4\
**Created:** [January 8, 2016, 6:47pm UTC](https://forum.sambapos.com/t/portion-selection-with-keyboard/8908 "2016-01-08T18:47:39Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![eminentcoder](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/e/c57346/32.png) [@eminentcoder](https://forum.sambapos.com/u/eminentcoder)\
**Post date:** [January 8, 2016, 6:47pm UTC](https://forum.sambapos.com/t/portion-selection-with-keyboard/8908/1 "2016-01-08T18:47:39Z")

</div>

Hi All,

We haven’t got touch screens in our setup. We have assigned five digit codes to all items as barcodes. Waiter just types the codes and presses enter to select the product.  
I have used Ask Question Action for portion selection. So when the waiter selects the product, system then asks for portion selection but that can’t be done with physical keyboard. He then have to select it with mouse. Its very time consuming to use mouse to select portion for every order after typing the code. Is there any way we can select the product portion using keyboard.

 ![](https://forum.sambapos.com/uploads/default/original/3X/8/d/8d19695dc01f12d79d8839a67738667c17f3c1df.png)

 ![](https://forum.sambapos.com/uploads/default/original/3X/9/a/9a48b248c8e0a710f1800bf032bf09ef87907957.png)

 ![](https://forum.sambapos.com/uploads/default/original/3X/6/3/63067e5e9a27308f69727489113a9f1d20eb1a0c.png)

 ![](https://forum.sambapos.com/uploads/default/original/3X/b/d/bda488fcb5eeac30c8d7da1d261ceae6ea81f0bd.png)

 ![](https://forum.sambapos.com/uploads/default/original/3X/6/7/67a516aa9b9ba0319f7731616adecaade087c4d8.png)

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [January 8, 2016, 8:12pm UTC](https://forum.sambapos.com/t/portion-selection-with-keyboard/8908/2 "2016-01-08T20:12:46Z")

</div>

🙂 {PORTION BUTTONS} is that a real working tag??? Never seen that one LOL When was that added, v4???

Anyway @eminentcoder are all your portions the same name? (Small, medium Large, Family)

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [January 8, 2016, 8:17pm UTC](https://forum.sambapos.com/t/portion-selection-with-keyboard/8908/3 "2016-01-08T20:17:47Z")

</div>

Long time ago in v4. Think it was before you came around 🙂

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [January 8, 2016, 8:22pm UTC](https://forum.sambapos.com/t/portion-selection-with-keyboard/8908/4 "2016-01-08T20:22:19Z")

</div>

I’ll be honest I’m trying to understand but I’ve never really found using a mouse to be that much slower than pressing a key. However maybe it is for your setup.

Currently there is not a way to link those buttons to keyboard. Most of the industry moved to touch years ago.

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [January 8, 2016, 8:26pm UTC](https://forum.sambapos.com/t/portion-selection-with-keyboard/8908/5 "2016-01-08T20:26:56Z")

</div>

I have an idea for a solution…  
If portions are the same options would be simple but sure they are not going to be…

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [January 8, 2016, 8:33pm UTC](https://forum.sambapos.com/t/portion-selection-with-keyboard/8908/6 "2016-01-08T20:33:33Z")

</div>

They don’t have to be same because the tag reads them and builds buttons.

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [January 8, 2016, 8:38pm UTC](https://forum.sambapos.com/t/portion-selection-with-keyboard/8908/7 "2016-01-08T20:38:08Z")

</div>

> [@Jesse](#):
>
> They don’t have to be same because the tag reads them and builds buttons.

I get that, but have a simple solution if they were the same,  
Numberpad entered rule with 4 update portion action with portion set in turn and constraints of numberpad = 1 / 2 / 3 / 4  
Would give you the ability to set the portion with the keyboard.

If they are not the same I have an idea for a script which would evaluate the possible portions and return them based on array index of input value (numberpad) minus 1 which would give you the corresponding portion name.  
1 = 1-1 = 0 = First portion…

But then not sure on V4 scriptability…

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [January 8, 2016, 8:46pm UTC](https://forum.sambapos.com/t/portion-selection-with-keyboard/8908/8 "2016-01-08T20:46:12Z")

</div>

Script like this 😄

```
function test(inputOrderName,inputPortionNumber) {
	var qry = "SELECT p.[Name]FROM [MenuItems] m JOIN [MenuItemPortions] p ON p.[MenuItemId] = m.[Id]WHERE m.[Name] = '"+inputOrderName+"'";
	var portionList = sql.Query(qry).Delimit(',').All;
	var portionName = portionList[inputPortionNumber-1]
return portionName
}
```

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [January 8, 2016, 8:47pm UTC](https://forum.sambapos.com/t/portion-selection-with-keyboard/8908/9 "2016-01-08T20:47:37Z")

</div>

V4 does not support any scripts.

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [January 8, 2016, 8:49pm UTC](https://forum.sambapos.com/t/portion-selection-with-keyboard/8908/10 "2016-01-08T20:49:06Z")

</div>

I did say wasn’t sure on script abilities.

But saw the scripts option in automation on screenshot…

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [January 8, 2016, 8:49pm UTC](https://forum.sambapos.com/t/portion-selection-with-keyboard/8908/11 "2016-01-08T20:49:39Z")

</div>

Scripts in v4 were something else entirely.

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [January 8, 2016, 8:52pm UTC](https://forum.sambapos.com/t/portion-selection-with-keyboard/8908/12 "2016-01-08T20:52:10Z")

</div>

Script works in v5 though 😄  
Although would probably want a way to handle if invalid number input.

If portion names are similar on all products wouldn’t be so bad.  
If they are all different probably doable with a lot of rules.  
Maybe time to look to upgrade @eminentcoder

If they are all different and decide to upgrade a script like this should do the job with a fairly basic numberpad rule.

```
function test(inputOrderName,inputPortionNumber) {
    var qry = "SELECT p.[Name]FROM [MenuItems] m JOIN [MenuItemPortions] p ON p.[MenuItemId] = m.[Id]WHERE m.[Name] = '"+inputOrderName+"'";
    var portionList = sql.Query(qry).Delimit(',').All;
    if (! portionList[inputPortionNumber])
    {
    var portionName = 'Normal';
    } else {
    var portionName = portionList[inputPortionNumber];
    }
    return portionName
}

```

Might need some tweeking as have only tested the return response but returns the portion name of eg 1st portion.

---

<div class="post-metadata">

**Author:** ![RickH](https://forum.sambapos.com/user_avatar/forum.sambapos.com/rickh/32/51960_2.png) [@RickH](https://forum.sambapos.com/u/RickH)\
**Post date:** [January 8, 2016, 9:37pm UTC](https://forum.sambapos.com/t/portion-selection-with-keyboard/8908/13 "2016-01-08T21:37:41Z")

</div>

Or scrap portions all together, and have different products setup as different portions which you can then assign a barcode to

For example

Normal 12345  
Small 123451  
Medium 123452  
Large 123453

First 5 digits of barcode are the same, the last digit is the portion size and will add that product

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [January 8, 2016, 9:38pm UTC](https://forum.sambapos.com/t/portion-selection-with-keyboard/8908/14 "2016-01-08T21:38:49Z")

</div>

Care to share a link?

---

<div class="post-metadata">

**Author:** ![RickH](https://forum.sambapos.com/user_avatar/forum.sambapos.com/rickh/32/51960_2.png) [@RickH](https://forum.sambapos.com/u/RickH)\
**Post date:** [January 8, 2016, 9:41pm UTC](https://forum.sambapos.com/t/portion-selection-with-keyboard/8908/15 "2016-01-08T21:41:53Z")

</div>

I dont have one, it was just a thought whilst reading 🙂

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [January 8, 2016, 9:47pm UTC](https://forum.sambapos.com/t/portion-selection-with-keyboard/8908/16 "2016-01-08T21:47:30Z")

</div>

Misread and thought you said assigning bar-codes to products… LOL was thinking where have you read that 😄

---

<div class="post-metadata">

**Author:** ![eminentcoder](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/e/c57346/32.png) [@eminentcoder](https://forum.sambapos.com/u/eminentcoder)\
**Post date:** [January 9, 2016, 7:34am UTC](https://forum.sambapos.com/t/portion-selection-with-keyboard/8908/17 "2016-01-09T07:34:22Z")

</div>

Wow, So many replies that soon.  
We are definitely going to upgrade to V5 soon. I have installed SambaPOS V.4 in just the Dine - In sections in all of our three branches, but our staff is continuously asking me to make the portion selection via keyboard.

@JRTech, Our portions are not the same. So that option isn’t going to work for me.  
And also making the portions as products and assigning them different codes isn’t a solution for us either as RickH mentioned.

All I was thinking about till now was to create lot of rules for all products as my final bet. But as @JRTech pointed to using scripts in V5. That’s interesting.  
I haven’t read about scripts in Samba yet. What type of scripting that is Sql script / JScript …

Thanks a lot to all for this nice help. I am gonna study the scripting feature in samba forum and then will give it a try in the unregistered V.5 version. And will come back soon here to ask for more help if needed.

---

<div class="post-metadata">

**Author:** ![emre](https://forum.sambapos.com/user_avatar/forum.sambapos.com/emre/32/39073_2.png) [@emre](https://forum.sambapos.com/u/emre)\
**Post date:** [January 9, 2016, 1:02pm UTC](https://forum.sambapos.com/t/portion-selection-with-keyboard/8908/18 "2016-01-09T13:02:13Z")

</div>

Is there any specific reason for not using a touch screen monitor?

---

<div class="post-metadata">

**Author:** ![eminentcoder](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/e/c57346/32.png) [@eminentcoder](https://forum.sambapos.com/u/eminentcoder)\
**Post date:** [January 9, 2016, 5:24pm UTC](https://forum.sambapos.com/t/portion-selection-with-keyboard/8908/19 "2016-01-09T17:24:54Z")

</div>

Because we just replaced our old pc’s with laptops due to too much power failure here in Pakistan and we didn’t consider touch screen’s at that time. So if I couldn’t do it using keyboard then I will consider buying touch screens for our Take - Away departs which need very fast procedure.

---

<div class="post-metadata">

**Author:** ![RickH](https://forum.sambapos.com/user_avatar/forum.sambapos.com/rickh/32/51960_2.png) [@RickH](https://forum.sambapos.com/u/RickH)\
**Post date:** [January 9, 2016, 5:39pm UTC](https://forum.sambapos.com/t/portion-selection-with-keyboard/8908/20 "2016-01-09T17:39:46Z")

</div>

If you can afford them get the touchscreens it will make your life so much simpler and make your process much much quicker 🙂

[Next page](https://forum.sambapos.com/t/portion-selection-with-keyboard/8908.md?page=2)
