Forum Discussion

ebonifacio's avatar
2 years ago

Get ID from a board's category

Hello

I'm trying to add a component to some boards, but I need to add from specific category.

How do I get the category ID from these boards? so I can make my condition.

 

 

    • VikasB's avatar
      VikasB
      Boss

      djondinium 
      coreNode.id will return the board id if you are on a board page or message/article page. 

      ebonifacio 
      Here you can check how you can apply category conttraint in the quries

      For Root

       

      select * from boards WHERE root_category.id = 'ABC'

       

       

       For Parent

       

      select * from boards WHERE parent_category.id = 'ABC'

       

       

      For mutiple categories 

       

      select * from boards WHERE root_category.id IN ('ABC', 'XYZ')