Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I use the custom field id in a query?

Martin August 14, 2018

I have a custom field which is a dropdown where I have a list, once I make the selection of an item from that drop, what I need is that in another dropdown, show me just the childreen of the first selection.

I'm using nFeed for the configuration of the querys that I need for extracting the first list, in theory I already have the query for just extract the childreen, but what I dont know is how to actually use what is in the fisrt field so it can make the correct extraction of the information that I need for the second field.

PD: I cant use static data because each item on the first field has it own and different childreen

1 answer

0 votes
Mohamed Benziane
Community Champion
September 4, 2018

Hello,

The parent list have a null value in customfieldoption in the database, and the child have a value (e.g 11700).

 

select customvalue from customfieldoption cfo join customfieldvalue cfv ON 
cfo.customfield = cfv.customfield
and cfo.id = cast(cfv.STRINGVALUE as decimal)
where cfo.customfield=11702
and cfo.parentoptionid ISNULL

 This query will select you only the parent option

Suggest an answer

Log in or Sign up to answer