Pass field name on query trigger

I know that i is passed to any query that is triggered, but the field name would be very useful. In a listview, it would be helpful to identify which field in that instance is triggering a query. It would also be great for creating common queries that execute slightly differently based on what triggered them, rather than creating a unique query for every case.

ahaaa, yep we’ve definitely heard this before! totally agree, it’d be really useful

woops… we’re already way past the timeline i already promised :frowning:

i’ll take a look today and get you a real timeline

hey @alex-westreich, just to clarify, when you say you want the “field name”, what are your use-cases? there are many things that might trigger a query, e.g.:

  • a dependency is updated (e.g. a query depends on {{textinput1.value}}, and the input changes
  • a query is manually triggered from a widget event (click, blur, etc)
  • a query is triggered based on the on success of another query
  • likely other things i didn’t think about
    i think the “query is manually triggered from a widget event” is an easy one on our end to solve, and the other ones might be more complicated

@abdul-nimeri, my use case for this has always been a widget event, and I want to know which component (textinput1) triggered the query. Right now I’ve got a nameTrigger, qtyTrigger, etc in a listview so I can tell which field, combined with i, triggered the query. If a certain field is edited, I only want to edit that key in the table.

Just a source variable that is available inside the query that returns the name of the field would be awesome. (triggerSource == “toggleFruit”)? addFruit(): addVeggies()

got it, we can definitely implement that. i’ll chat with the team to decide on the interface for this, but otherwise hopefully we’ll get it done this week!

Awesome!

quick gif of what you can expect:


1 Like

i renamed it from triggeredBy to triggeredById, but otherwise it’s the same