Thanks again @sid.
This works perfectly and is definitely a much cleaner solution. I do need that flow elsewhere so I left it as and external flow and passed the parameters.
<select id="select_tb" class="form-control" dmx-bind:options="sc_tripbits_list.data.query1" optiontext="title" optionvalue="tripbit_id" dmx-bind:value="tripbit_id" dmx-on:changed="flow_image_update.run({tripbit_id: value, public_id: public_id})"><option value="">Select a Tripbit</option></select>
<script is="dmx-flow" id="flow_image_update" type="text/dmx-flow">{
meta: {
$param: [
{type: "number", name: "tripbit_id"},
{type: "text", name: "public_id"}
]
},
exec: {
steps: {
runJS: {
function: "updateImage",
args: ["{{$param.public_id}}", "{{$param.tripbit_id}}"],
name: "update_image_flow",
output: true
}
},
catch: {
bootbox.alert: {title: "Alert", message: "Something went wrong"}
}
}
}</script>