Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • Sounds like the solution I was looking for, but I don't get it working (unfortunately I have no python experience): I tried to run it with python console: no error, no result and as Action: "unable to run command". I only changed the expression for testing from 'a + b' to '1 +2'. Using QGIS 3.14, Layer: GPKG. Could you please give more details for using this code? Commented Oct 11, 2020 at 7:37
  • I added some instructions in the main post. Commented Oct 11, 2020 at 11:16
  • Try running it as a script, not in console and remember to replace a, b and c in code with proper field names Commented Oct 11, 2020 at 11:18
  • 2
    I edited the code in accordance with Matthias's comment. The layer is chosen beforehand, instead of using iface.activeLayer() Commented Oct 12, 2020 at 6:48
  • 1
    Thanks. Please disregard the stability comment, this only applies if it's an expression function and not the implementation here. All good. Commented Oct 12, 2020 at 8:56