Page 1 of 2
How to "store" selcted items
Posted: Tue Mar 19, 2024 12:42 pm
by mighty0n3
Hello,
i have a rather simple form which contains a checked list box (name: licenses) and I want to store the selected values into a variable (Name: abc) upon click on "OK" Button in order to use the selected values in a SQL query.
How do I do that?
Re: How to "store" selcted items
Posted: Tue Mar 19, 2024 8:48 pm
by Lech Kulikowski
Hello,
The Form is obsolete. You can use the Request From User option for the variable, and then use this variable in the query.
Thank you.
Re: How to "store" selcted items
Posted: Thu Mar 21, 2024 1:14 pm
by mighty0n3
Do you have some kind of example for the "Request From User option" or a "how to" so to say?
Re: How to "store" selcted items
Posted: Thu Mar 21, 2024 8:15 pm
by Lech Kulikowski
Re: How to "store" selcted items
Posted: Fri Mar 22, 2024 9:27 am
by mighty0n3
Ok, understood.
If i want to use the selected Values as paramter in my query it says "Cannot convert StringList to string"
Can it be worked around with an expression for example?
Re: How to "store" selcted items
Posted: Fri Mar 22, 2024 10:22 pm
by Lech Kulikowski
Hello,
In this case, you should use the ToQueryString() for the list variable.
Thank you.
Re: How to "store" selcted items
Posted: Mon Mar 25, 2024 9:54 am
by mighty0n3
If I use your example in my SQL-Query (of course with correct var-reference) results in Parse error: Syntax error
Concerning bit of SQL-Query: AND L.SkuPartNumber IN {(us_lic.Count == 0 ? "('')" : "(" + us_lic.ToQueryString("'") + ")")}
Re: How to "store" selcted items
Posted: Mon Mar 25, 2024 2:51 pm
by Lech Kulikowski
Hello,
If the SkuPartNumber is numeric, please try to check:
IN {(us_lic.Count == 0 ? "(0)" : "(" + us_lic.ToQueryString() + ")")}
Thank you.
Re: How to "store" selcted items
Posted: Tue Mar 26, 2024 7:05 am
by mighty0n3
Nope, it's a string
Re: How to "store" selcted items
Posted: Tue Mar 26, 2024 10:27 am
by Lech Kulikowski
Hello,
Please send us a sample report with test data for analysis.
Thank you.