This describes how to work with Tags so that they are generic and can be used by one or more applications or use cases without negative interference.  The main issue to be concerned with is that SAFR Tags should be set as name/value pairs and names should be unique.  This way, multiple users or scripts can use the tags field without interference.

Any user of SAFR Tags should not only add tags using name/value pairs but also read tags in such a way as to handle any tags that is is not aware of and preserve those.


While its not enforced in the user interface, tags have a very specific syntax. Tags should be comma separated list.  From there it can be name/value or just any string but name/value separated by equal sign is recommended.  Values are stored in an array of strings.

Syntax when entering in UI:

var1=1, var2=2"alias2=Fullerton, Steven""alias=Mr S"


Syntax when submitting via REST API:

            "tags": [
                "var1=1",
                "var2=2"
            ],


REST API will return as an array as shown above.  

 UI will display back as comma separated string

Syntax when submitting via REST API:

            "tags": [
                "var1=1",
                "var2=2",
                "alias1=Mr S",
                "alias2=Fullerton" Steven"
            ],


As shown, if value contains a comma, then you need to escape it with some sort of encoding.

Because mongo does not guarantee order, the array may be scrambled as shown below:


Tabs in SMS Message

The #tags token in an SMS message will be replaced by the comma separated list of tags stored in the person record.  No formatting is applied.  The list is presented as a single comma separated string as shown in above screenshot.

Another example

"group=Self Excluded""exclude-until=2021-10-27""Member ID=ExtID1234567", var1=1, var2=2"alias2=Fullerton, Steven""alias=Mr S"


Examples:

How they appear in Desktop app:

In web console:


Custom sms format:

#alarm #idClass #personType
#tags
#site - #source
#link


Resulting SMS Msg: