# Is there an advance guide to Samba?

**URL:** <https://forum.sambapos.com/t/is-there-an-advance-guide-to-samba/24974>\
**Category:** V5 Question\
**Created:** [November 11, 2021, 8:28pm UTC](https://forum.sambapos.com/t/is-there-an-advance-guide-to-samba/24974 "2021-11-11T20:28:28Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Bob\_be](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@Bob\_be](https://forum.sambapos.com/u/Bob_be)\
**Post date:** [November 11, 2021, 9:16pm UTC](https://forum.sambapos.com/t/is-there-an-advance-guide-to-samba/24974/3 "2021-11-11T21:16:48Z")

</div>

> [@rcmalonso](#):
>
> Hello I would like to know if there’s any guide that shows in depth topics such as conditionals or switch cases using constraints

Using the above link, searching the forum or asking questions.

> [@rcmalonso](#):
>
> Like if I want to have a button to save a note when the note field is empty (in a task) but if I click the button again instead of prompting to enter the note, I want to open a popup showing previous note and then clear the note if needed.

You are obviously going to need 2 rules. Both with the Automation Command Name with the name Task Note (as an example). You will need to add another constraint to each rule to select the correct rule. You are not restricted to the drop down options, you can use a report, printer tag, settings value, etc (depending on the rule event). In your case you want to know if a tasks’ note field Is Null or Is Not Null. That would require a report. Something like this: `{REPORT OPEN TASK DETAILS:TSC.Notes:T.Identifier="<id number"}` or something similar. (This is assuming you have some type of task identifier tied to the ticket.)

Assuming you want to edit a note, you probably want to use a prompt. This post offers a lot of useful information:

> [@Custom Keyboard Codes](https://forum.sambapos.com/t/custom-keyboard-codes/3006):
>
> As of v4.1.61 we can create Custom Keyboards to use with [?prompt] notation, and a Custom Keyboard Widget is available for Entity Screens. For [?prompt] notation, the syntax is: [?\<prompt\>;\<mask\>;\<default value\>;\<flags\>;\<keycodes\>] \<prompt\> is the question or prompt to display \<mask\> is a regular expression to define what type of characters (and how many) are allowed \<default value\> allows for a common value to be pre-entered \<flags\> lets you define the keyboard type and which buttons …

Your prompt is going to look something like this: `[?Notes;;{REPORT OPEN TASK DETAILS:TSC.Notes:T.Identifier="<id number"};OC;]` This will load the report results as the default text.

Depending on which Task field you are using, you are going to have to mask some characters. If you are using a Custom Field you are going to want to mask out both types of quotes, pipes and comma’s. If you are using Content field as notes, I think you just have to mask out pipes and comma’s. The reason is that these characters mess up the report results or will not be written to the database.

---

_[View the full topic](https://forum.sambapos.com/t/is-there-an-advance-guide-to-samba/24974)._
