1) My goal:
I have three select components: one for customers (select_request_customer_add), one for objects (select_request_object) which loads objects of selected customer, and one for work types (select_request_work_type). Based on selected object and work type, i query assignments (table assignments) to get executor_id, which should automatically populate as default in the main_executor_add select (that loads data from users table filtered by role = 'executor').
2) Issue:
Query get_executor_for_assignment returns correct executor_id (and even executor_name joined from users). But setting default value in main_executor_add select using this value does not work. The select remains empty with placeholder.
3) Steps I've taken to troubleshoot:
- Verified that get_executor_for_assignment returns valid uuid matching id in users table.
- Verified types (all uuid).
- Tried using state variable and direct query result in Default value field of select.
- Verified component names, ids, data source mappings (value mapped to item._id, label mapped to item.name).
- Tried using control component action in query success handler.
4) Additional info:
- Executors list comes from get_executors query (SELECT id, name FROM users WHERE role = 'executor').
- I also need to retain possibility to manually select another executor, but default should populate automatically based on assignment matching selected object + work type.
I need help, how exactly to set default value or force select to pick item by id using query result or variable.