Select to view content in your preferred language

Edit Existing Data Expressions Directly

727
0
12-04-2023 10:34 AM
Status: Open
Labels (2)
jcarlson
MVP Esteemed Contributor

Say I have a chart widget based on a Data Expression. It's got a lot of customization going on, and after a lot of tweaking, it looks just how I want it. But then I realize I need to change something about the expression, something minor like how some text is being formatted in a field.

When I save the edits to my expression, all of my chart's configuration goes away!

Now, I get it, I could drastically change my Data Expression to the point that the existing configuration no longer applies. But I'd rather see an error message to that effect than have my configuration disappear completely.

The heart of the issue: I want to edit an expression without losing widget configuration.

Current Workaround: Edit a Placeholder Widget

Now say there are two widgets in the dashboard. I can edit the expression on Widget A, and any changes I make will reflect on Widget B. Great! But this does me no good if I actually want both widgets.

What I've been doing up to now is to clone an existing widget, edit the expression there, then delete the widget. It mostly works. But I run into an issue if I attempt further dashboard edits.

Where it Fails

Okay, so here' the situation.

  1. I have Widget A, and I want to update the expression it uses as its source.
  2. I clone it and edit the expression on Clone A.
  3. I remove Clone A.
  4. I make an additional edit to Widget A, or really any other widget which uses the same Data Expression.
  5. I save and reload the dashboard.
  6. I lose all my changes that I made to Clone A.

Editing on a placeholder only works if I immediately save and reload the dashboard making further edits. This is because even though the widgets share an expression, in the underlying JSON, the entire expression is stored in each widget. It would seem that the expression in the most recently edited widget is passed to any other widget when the dashboard is saved, though I'm not certain.

What I'm Suggesting

Maybe in the sidebar menu, what if there were an item for Data Expressions. You could select an expression from there and edit it, without risking losing configuration on a widget, or requiring the creation of a placeholder widget. Changes there could propagate to any connected widgets' JSON, to avoid overwriting one's own work.

Essentially, that menu that opens when you go to add or change a widget's data source, the list of in-use sources and expressions, I want to be able to open that menu without editing a widget.