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

Privacy overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognizing you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.


To see a full list of the cookies we use and learn more about their purposes, visit our Privacy Policy.