From 0e4f8712d7ed1c4c730ef4642de078c39766ee58 Mon Sep 17 00:00:00 2001 From: Bjarte Mellemstrand <95030573+BjarteMell@users.noreply.github.com> Date: Tue, 13 Oct 2026 15:58:05 +0200 Subject: [PATCH] Two-argument expressions: no spaces allowed, and brackets needed in GET MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The space breaks the expression in both GET and POST. Tested on SSB 07459. SCB TAB6471 behaves the same: `[top(2, 1)]` gives 400 and `[top(2,1)]` gives 200. Spaces in a plain list are fine (`valueCodes[Tid]=2024, 2025` works), so only spaces inside an expression fail. In a GET URL, an expression containing a comma must be wrapped in square brackets**, because a bare comma is the list separator. The guide hints at this in lines 924–926, but the sentence is incomplete: > If the value code should be surrounded by square brackets like `3,[1,2],4+5`. --- docs/PxWebApi/documentation/user-guide.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/PxWebApi/documentation/user-guide.md b/docs/PxWebApi/documentation/user-guide.md index 959de31..a8f8eb5 100644 --- a/docs/PxWebApi/documentation/user-guide.md +++ b/docs/PxWebApi/documentation/user-guide.md @@ -921,8 +921,7 @@ valueCodes[variable-id]=value-code1, value-code2 ``` You need to specify value codes for each variable that is not eliminable. The -value codes are given in a comma separated list. If the value code should be -surrounded by square brackets like `3,[1,2],4+5`. See bellow on how to specify +value codes are given in a comma separated list. If a value code or a selection expression contains a comma, wrap it in square brackets, e.g. `valueCodes[Tid]=[range(2002,2005)]` or `[top(5,1)]`. In a POST body, write the expression without brackets: `"range(2002,2005)"`. A bracketed string in POST is looked up as a value code and fails with `Non-existent value`. See bellow on how to specify value codes. You change can specify a different codelist for a variable the possible once @@ -1018,14 +1017,14 @@ as specified in the metadata. The syntax of the experssion is: ```sh -top(numberOfValues, offset) +top(numberOfValues,offset) ``` where `numberOfValues` specifies the number of values codes that should be selected from the top and `offset` is an optional offset from the top. E.g. - `top(5)` will select the first 5 values. -- `top(5, 1)` will skip the first value and select the next 5 values. +- `top(5,1)` will skip the first value and select the next 5 values. ##### bottom @@ -1036,14 +1035,14 @@ as specified in the metadata. The syntax of the experssion is: ```sh -bottom(numberOfValues, offset) +bottom(numberOfValues,offset) ``` where `numberOfValues` specifies the number of values codes that should be selected from the bottom and `offset` is an optional offset from the bottom. E.g. - `bottom(5)` will select the last 5 values. -- `bottom(5, 1)` will skip the last value and select the next 5 values counting +- `bottom(5,1)` will skip the last value and select the next 5 values counting from the bottom. ##### range @@ -1054,7 +1053,7 @@ in the metadata. The syntax is in the form ```sh -range(value-code1, value-code2) +range(value-code1,value-code2) ``` Example if you have a time variable that have codes from the year 2000 to 2025