Arcade: Return a custom informational message to the application

1729
2
03-21-2022 06:05 PM
Status: Open
Bud
by
Notable Contributor

In an Arcade calculation attribute rule, return a custom informational message to the user/application if an operation was performed successfully.

For example, an attribute rule is designed to create a record in a related table: LIFECYCLE_TRANSACTIONS.
It would be helpful if we could inform the user that the related record was created (the user might not be aware). The user might need to review the record and edit it with comments, etc..

Tags (2)
2 Comments
Bud
by

Edit:

I like @JohannesLindner‘s idea better:

[Put the custom message] in the Create Features Pane / Modify Features Pane. The generic success messages and error messages are shown there already, so imo that's the right place for custom messages.


Similar to this, but it would be a custom information message, not an error message (source) :

116EEF6F-CB8D-44F1-A219-B8779E014FE5.gif


Disregard:

For example, a temporary "green information bar" at the top of the map could appear. And then after a few seconds, it would be automatically hidden.

That's how it works with the map in IBM Maximo Spatial. It's a pretty reasonable way to show a message. It's not as annoying as popup dialog window. But it's also visible enough to get the job done...it provides a message to the user...and the user can ignore it if they want to.

https://i.stack.imgur.com/h7DxG.png 

 

 

JohannesLindner

 

Hmmm... I see the need for the user to know what happens if they edit a feature class.

First of all, I think that is your responsibility as database admin or data owner. If you grant write privileges to a user, you better make sure they understand the data structures and edit workflows they are dealing with.

But a message to remind the user or to control that the rules work correctly couldn't hurt.

I see two ways that could be implemented:

 

ArcGIS notifies the user automatically when a table gets edited due to an Attribute Rule.

That would be bad for these reasons:

  • In some cases, you get other feedback and don't need the message.
    • eg. I insert a point, snap it to a line and split the line on that point. I can see the result on the screen, the message is unneeded ballast.
  • Some Attribute Rules edit many tables (up to 5 in my case). I would hate to have that many messages pop up every time I make an edit.
  • If this is a workflow I do often, or if I edit many features during an edit session, then I know what happens. After I saw the message a few times, I know. At that point, it's completely unnecessary and just annoying.

 

You define it in the rule, similar to the errorMessage keyword:

 

var value = 5
return {
  "edit": [{
    "className": "OtherClass",
    "adds": [
      {"attributes": {"Field": value}}
      ]
    }],
  "successMessage": "We did it! 1 feature created in OtherClass."
}

 

Technically, you would be lying to the user, because at that point the edits wouldn't be applied yet, but that's the whole philosophy behind positive UX design...

This method would be good, because

  • It is customizable. Instead of a generic "Feature added to Class X", you can return a specific message.
  • This also means you can tell the user that multiple classes were edited in one message.
  • It's optional. For edit workflows that you expect to do often, you just don't return a message, because you know what happens.

 

 

Personally, I wouldn't want the message to show up on the top of the map, like in your mockup, but in the Create Features Pane / Modify Features Pane. The generic success messages and error messages are shown there already, so imo that's the right place for custom messages.

JohannesLindner_0-1648713362944.png

JohannesLindner_0-1648713581725.png