Easier method to clear a large number of variables in one action

I have a button that clears the variables so operator can have a clean start to input values into variables in a step. For the button I need to have one action for each variable to clear. For this one step I have more than 20 variables and therefore 20 actions in that one trigger. Very tedious to type essentially the same action numerous times with the only difference being the name of the variable.

It work help if there was a feature instead of clearing just one variable we get a listing of all the variables and we get an to “select all” or select/deselect individual variables to clear. This would be similar to excel data list when you want to filter the data set in a column using the DATA/Filter feature and I get to pick what I want to filter by. In Tulip case, it would be which variables I want to clear.

Hey Attaboy, I think in many cases like this people just restart the app (which can be done with a trigger), or “complete” the app. Do you have many other variables that you don’t want to clear? Or if it is only a few that you don’t want to clear it might be easier to just reinitialize them at the top of the app

1 Like

Thanks for this, Ethan!

I had the same thought as Attaboy, and this solution addresses my use-case.

It would still be nice to be able to group variables in folders like we can group steps, that way we can reset only one folder. Plus it has other uses beyond only resetting.

1 Like

@Ventsi, I love this suggestion for grouping variables. @kimberly :eyes:


Thanks for this, it’s an interesting idea! Can you give some examples of groups you might want to create? I’m particularly curious about the difference between variable folders and object variables that allow multiple properties.

1 Like

I think the fundamental problem with object variables - as they could very much act like a variable group - is that in the current Tulip environment it is almost prohibitively difficult to add changes to them once an app has been built.

Linking to any property in an object freezes the object. Say you want to add an additional property later on, you would have to break everything in order to do so.

Offering groups of variables instead could be a way to solve that problem and the original one of this post - if they are not locked in.

Or you find a way to enhance the object type in Tulip to make it more user friendly. As a programmer I would use objects every time. But working with them in Tulip is a pain in its current form. Even more so with object arrays as there are important service functions missing.

Aditionally objectlists from a connector output can’t be part of the “folder” object.

I would also like to be able to have the “set to default value functionality” to some variables but not all.
Currently there is a “Reset all App Variables to Defaults” Action. However I’d like to save some Variables from that. I want to set one variable or a group of variables back to default.

This would totaly make sense, to select multiple variables as a target of one data manipulation (no matter if clearing, initializing, incrementing, writing a static value, setting to default…).

@sebme and @thorsten.langner, these are really great insights , thanks for sharing! Over the next year we’re doing a lot of foundational work on how we structure and process data across the platform, so any and every perspective you share goes a long way toward building the best possible platform.

Running into this as well when trying to use various input widgets to filter table data in-app. Often need to clear multiple variables with one button click to “reset” the filtering without restarting the app. This is necessary when you are trying to include/exclude table fields with null vs. empty string values.

Even being able to add multiple variables at the end of a Data Manipulation>Clear>Variable(s)> would be a big improvement over separate lines for each Clear.

I’m in complete agreement with @sebme that Object variables are incredibly difficult to modify after initial setup. If another method of grouping or enhancements to Objects are coming down the line, I can’t wait!

I have an example where I setup an Object called “Query Fields” that contains all the various filters for fields in a table. For me to add an additional field to this existing Object I would either need to remove all references using it or what I typically do is duplicate it, add the new field, and then update all references from the old Object to my new Object. Either way very tedious and if I’m not careful could cause issues.

That said, back to the original topic of this forum post, using an Object was great to visually organize similar variables into a grouping and was a huge time saver for me when it comes time to clear the filters as I can simply Clear the Object instead of each individual filter. I have many triggers in the app where this needed to occur so I’m glad I figured that out!

In my opinion this comes with some more connected issues.

  • Variables under an object are always a hurdle when it comes to select variables in drop downs.
    → Searching by name will find the first match, but they are not in the order of the alphabet, since they are sorted by its objects name
    → you cant find the child by a parents name (if the parent does not mach the needed data type)
    → objects are a pain to modify (as already mentioned)
    → In the Data Source of widgets (e.g. Text Input) you only see the child’s name, without knowing the parent. You have to scroll through the whole variable list by hand. In the trigger editor, it shows the parent when clicking the drop down…

  • Sometimes you want to reset the Value to default (e.g. colors, default navigation values…)
    → there is only a reset all variables to default function, otherwise you have to reset every variable by hand…

  • Text Variables often need to be initialized as an empty text (not null / clear)

All of these things would be easier, if you could make one data manipulation on a list of variables.
However a “set to default value” is still missing for not all variables.
And an “empty string” as default for a text variable is also missing.

I guess all of these circumstances are a good reason to think about a concept and not a single “fix”.
→ Finding and selecting variables
→ Displaying selected variables
→ Manipulate the values of a list of variables (Clear, set to default, set to a specific value (as empty string))
→ modifying objects

1 Like