Search (Query) parameters #194
Replies: 3 comments 1 reply
-
I tried another experiment with Supplier Invoice File Connections |
Beta Was this translation helpful? Give feedback.
-
Interesting.. and confusing :) |
Beta Was this translation helpful? Give feedback.
-
Hi We are creating a transfer of time to Fortnox salury. |
Beta Was this translation helpful? Give feedback.
-
Description
I did some tests/research around search parameters.
Here are some notes to think of
As stated in the Fortnox documentation, search parameters are used on server side in database/sql
LIKE
operation. Server also adds an%
to both start and end of the parameter value.Example: Specified parameter
123
ends up being%123%
before used in database operation.LIKE operation supports two wild card characters. These can be used in the search parameter value as well
%
- representing an optional sub-string similar to regex.*
_
- representing any character similar to regex.
The wildcard characters can be escaped to search for a value containing the character
_
or%
by using slash, e.g.\_
or\%
Problems
It can be very confusing sometimes when a single entity is expected, but several are retrieved by the query.
Examples:
1)
Parameter value: 123
Matches: 123, 1234, 1235 or even A123
2)
Parameter value AB_12
Matches: AB_12, ABC12, AB112, or even XABC12X
Conclusion
The problem I see is that there is no way to specify that user wants only exact matches. Something like
^
and$
in regex.I believe that the server-side "feature" which wraps the parameter with
%
is a bad idea and it should be up to user to specify them if needed. This way the user needs to filter the results explicitly after retrieving them to get only the exact matches.Also, the documentation does not mention that the
_
and%
needs to be escaped. It is something I found out just now by digging into it.What do you think?
Open questions
ABC\
? After server adds the percent characters e.g.%ABC\%
, will the ending wildcard actually be escaped? :)Beta Was this translation helpful? Give feedback.
All reactions