-
Goal: I want select2 to change depending on select1, dynamically. I am very inexperienced with retool generally so not sure how this works
-
Steps: I have a query called roleList (image below). Choose Category select has it's values set. Choose a role then pulls the roles depending on the values from from choose a category, but this only works when I specifically run the query - I need it to work dynamically.
-
Details:
// Create a mapping object for categories and roles
const rolesByCategory = {
"Accounting": ["AR", "AP", "Billing", "Bookkeeping", "Accounting", "Payroll", "Revenue Ops", "Tax"],
"Customer Support": ["Customer Success", "Customer Support", "Customer Service", "Technical Support", "Helpdesk (T1/2)", "Travel Agent", "Executive Assistant"],
"Data Handling": ["Data Entry Specialist", "Document Control Specialist", "Quality Assurance/Control"],
"HR and Recruitment": ["Executive Assistant", "Office Administrator"],
"IT and Design": ["Systems Administrator"],
"Marketing": ["Social Media", "Growth Marketing", "Email Marketing", "Marketing", "SEO Manager", "Copywriter", "Content Writer"],
"Operations": ["Project Manager", "Operations Associate", "Logistics Associate", "Supply Chain Associate", "Procurement Associate", "Delivery Manager"]
};
// Get the selected category from your category dropdown component
const selectedCategory = select1.value; // Ensure selectCategory matches the ID of your category dropdown component
// Return the roles for the selected category, or an empty array if no category is selected
return rolesByCategory[selectedCategory] || [];
- Screenshots:
Please help!