Home > Forum > General > Choice field multiple values

Choice field multiple values
0

Hello,

I have created a Choice field that allows multiple values.
I noticed that the 'wfd_attchoose' column saves both the ID and Name, while the 'wfd_attchoose1_id' column only stores the first ID.
I am wondering why I cannot see all the IDs and how I can extract each value individually.

Can you help me with a suggestion? Thank you.

In reply to: Maksymilian Stachowiak

Hi
This is by design - you can read more here:
https://community.webcon.com/posts/post/indexed-choice-columns/406

If you want to get all the ID's you should look at the dbo.ClearWFElemID function - it's also mentioned in above article.

I have created a DB with the following query:
select dbo.ClearWFElemID(WFD_AttChoose1) as CategoryIDs, wfd_id as id from wfelements

and it is returning only the first ID from my Choice field-multiple values.

MVP
In reply to: AndreeLl B

I have created a DB with the following query:
select dbo.ClearWFElemID(WFD_AttChoose1) as CategoryIDs, wfd_id as id from wfelements

and it is returning only the first ID from my Choice field-multiple values.

Ah, this one is not in the article - you could use ClearWFElemIDAdv like this:

SELECT WFD_AttChoose1, dbo.ClearWfElemIDAdv(WFD_AttChoose1) as x FROM WFElements WHERE WFD_ID = 123123

You will probably also need dbo.SplitToTable, below two possibilities how to use them:

-- ClearWFElemID Example

SELECT
dbo.ClearWfElemID(query.item) As ID,
dbo.ClearWfElem(query.item) As Value
FROM
dbo.SplitToTable((
SELECT WFD_AttChoose1 as x FROM WFElements WHERE WFD_ID = 123123
), ';') as query

-- ClearWFElemIDAdv Example

SELECT
query.item
FROM
dbo.SplitToTable((
SELECT dbo.ClearWfElemIDAdv(WFD_AttChoose1) as x FROM WFElements WHERE WFD_ID = 123123
), ',') as query

Did you know that with WEBCON you can automate virtually any process? Even baking cookies 🍪
 
Speaking of cookies: we use the ones that are essential for our website to function properly, as well as additional ones that help us customize our content to your preferences. If you don’t mind cookies, click Accept. If you want to learn more, explore settings.
Settings