A user developing their first custom workflow in ControlUp encountered difficulty retrieving a specific device ID based on a machine name entered through a form trigger. The intended workflow started with an admin entering the machine “name” value from the _devices index into a form. This form submission was meant to trigger a workflow step that queries and returns only the device_id corresponding to the given machine name.
The user configured the “List Device ID” step to filter devices with the condition name = {{Start.DeviceName}}, expecting to receive one device_id as output. Instead, the query either returned a complete list of around 1200 device IDs or an empty array, failing to isolate the single target device.
The key to resolving this issue was understanding the correct variable reference syntax in ControlUp custom workflows. The user was incorrectly using {{Start.DeviceName}}, but the proper syntax for accessing form input data from the workflow trigger is {{Start.Form.DeviceName}} (or similar, using the start.form series of variables). Updating the filter condition to name = {{Start.Form.DeviceName}} enabled the workflow to correctly narrow down to the exact device and return only its device_id without extraneous results.
This highlights the importance of accurate variable referencing in ControlUp workflows, particularly when using custom form triggers to filter data. When filtering on form inputs, the recommended practice is to use the start.form variables to access form fields. For additional guidance on custom workflow variable usage, referencing ControlUp’s official workflow and automation documentation is advisable: https://docs.controlup.com/controlup-workflows.
Read the entire ‘How to Correctly Reference Form Variables in ControlUp Workflows to Retrieve Device IDs’ thread below:
Hello, working on my first custom workflow and I am confused and need some help
I am doing a form trigger for the workflow where the admin would enter in the “name” value of a machine from the _devices index. This form would then be the trigger for a workflow to get the device ID.
My config for the List Device ID step looks for name = {{Start.DeviceName}} and I only want to return the device_id value. When I configure it this way, I am either returning all of our 1200 devices (with just the device ID for each), or am returning an empty array for the device I was trying to target.
Hoping I am just doing something silly…
use the start.form series of variables. For example:
That was it… Thanks!
Continue reading and comment on the thread ‘How to Correctly Reference Form Variables in ControlUp Workflows to Retrieve Device IDs’. Not a member? Join Here!
Categories: All Archives, ControlUp Scripts & Triggers, ControlUp Workflows
