Hello,
I am working on a bot that should create a purchase requisition.
I have several entities that are numeric. For example, plant is a four digit number or G/L account - a six digit number. When the user is asked for quantity, he enters a number. Normally it should be recognized as #number and can be processed further.
Sometimes this number is recognized as a plant or account.
In this case I wanted to save the current message in fallback-skill as quantity. I just need to check that the entry is numeric.
How can I check if the current message or a memory field is numeric?
Best regards and thanks in advance!
Alicja
Request clarification before answering.
I would rethink the flow and try to get better detection, or ask for the quantity explicitly.But one way to detect a number is to add the number to itself and then test if you have a string or not:
NUMBER: {{isString (add "1" "1")}}
NOT NUMBER {{isString (add "A" "1")}}
The first returns false and the second returns true.
Unfortunately, I don't see any explicit function for testing or converting strings to numbers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.