Variabel til push melding

Er det i det hele tatt mulig å sette en variabel inn i en melding som går til push?

har sett litt på andre tråder, og sett blant annet hvordan man kan poste melding med variabel til timeline, men det funker ikke ser det ut som.

{
  "Id": "eVHpQYi1VBo0m4Z",
  "ClassId": "eVHpQYi1VBo0m4Z",
  "Author": "",
  "Version": 0,
  "CreatedAt": "2023-08-16T23:08:35.066084512+02:00",
  "UpdatedAt": "2023-08-16T23:15:51.400360524+02:00",
  "Name": "Test",
  "Group": "Test",
  "Description": "Test",
  "Nodes": [
    {
      "Id": "1",
      "Type": "trigger",
      "Label": "no label",
      "SuccessTransition": "3",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "pt:j1/mt:evt/rt:dev/rn:zw/ad:1/sv:out_lvl_switch/ad:12_1",
      "Service": "out_lvl_switch",
      "ServiceInterface": "evt.binary.report",
      "Config": {
        "ConnectorID": "",
        "InputVariableType": "",
        "IsValueFilterEnabled": false,
        "LookupServiceNameAndLocation": false,
        "PropFilterName": "",
        "PropFilterValue": "",
        "RegisterAsVirtualService": false,
        "Timeout": 0,
        "ValueFilter": {
          "Value": null,
          "ValueType": "bool"
        },
        "ValueJPath": "",
        "ValueJPathResultType": "",
        "VirtualServiceGroup": "",
        "VirtualServiceProps": null
      },
      "Ui": {
        "nodeType": "",
        "x": 434,
        "y": 173
      },
      "TypeAlias": "Trigger",
      "LastValue": true
    },
    {
      "Id": "3",
      "Type": "set_variable",
      "Label": "test variable",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "SuccessTransition": "4",
      "ErrorTransition": "",
      "Config": {
        "Name": "pushTrigger",
        "UpdateGlobal": false,
        "UpdateInputMsg": false,
        "IsVariableInMemory": true,
        "DefaultValue": {
          "Value": "test",
          "ValueType": "string"
        }
      },
      "Ui": {
        "x": 443,
        "y": 368,
        "nodeType": ""
      },
      "TypeAlias": "Set variable"
    },
    {
      "Id": "4",
      "Type": "action",
      "Label": "Publish timeline",
      "Address": "pt:j1/mt:cmd/rt:app/rn:time_owl/ad:1",
      "Service": "time_owl",
      "ServiceInterface": "cmd.timeline.set",
      "SuccessTransition": "",
      "ErrorTransition": "",
      "Config": {
        "VariableName": "",
        "Props": {},
        "RegisterAsVirtualService": false,
        "VirtualServiceGroup": "",
        "VirtualServiceProps": {},
        "DefaultValue": {
          "Value": {
            "message_en": "variabel = {{ \"pushTest\" }}",
            "message_no": "-",
            "sender": "flow"
          },
          "ValueType": "str_map"
        }
      },
      "Ui": {
        "x": 1020,
        "y": 218,
        "nodeType": "timeline_action"
      },
      "TypeAlias": "Timeline",
      "LastValue": "test"
    }
  ],
  "Settings": null,
  "IsDisabled": false,
  "IsDefault": false,
  "ParallelExecution": "parallel"
}

Takker!

Funker konseptet også på samme måte med variabel til push?

Her er demo for variabel i melding til tidslinje.

{
  "Id": "0r6WgEKJo9D2UpK",
  "ClassId": "0r6WgEKJo9D2UpK",
  "Author": "",
  "Version": 0,
  "CreatedAt": "2023-08-19T12:09:32.903244993+02:00",
  "UpdatedAt": "2023-08-19T12:09:32.903244993+02:00",
  "Name": "Variabel til Timeline",
  "Group": "Test",
  "Description": "Variabel til Timeline",
  "Nodes": [
    {
      "Id": "1",
      "Type": "trigger",
      "Label": "no label",
      "SuccessTransition": "2",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "pt:j1/mt:evt/rt:dev/rn:zw/ad:1/sv:out_lvl_switch/ad:12_1",
      "Service": "out_lvl_switch",
      "ServiceInterface": "evt.binary.report",
      "Config": {
        "Timeout": 0,
        "ConnectorID": "",
        "ValueFilter": {
          "Value": null,
          "ValueType": "bool"
        },
        "PropFilterName": "",
        "PropFilterValue": "",
        "ValueJPath": "",
        "ValueJPathResultType": "",
        "InputVariableType": "",
        "IsValueFilterEnabled": false,
        "RegisterAsVirtualService": false,
        "LookupServiceNameAndLocation": false,
        "VirtualServiceGroup": "",
        "VirtualServiceProps": null
      },
      "Ui": {
        "x": 340,
        "y": 177,
        "nodeType": ""
      },
      "TypeAlias": "Trigger",
      "LastValue": true
    },
    {
      "Id": "2",
      "Type": "set_variable",
      "Label": "Variabel",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "SuccessTransition": "3",
      "ErrorTransition": "",
      "Config": {
        "Name": "TimelineVariabel",
        "UpdateGlobal": false,
        "UpdateInputMsg": false,
        "IsVariableInMemory": true,
        "DefaultValue": {
          "Value": 0,
          "ValueType": ""
        }
      },
      "Ui": {
        "x": 392,
        "y": 364,
        "nodeType": ""
      },
      "TypeAlias": "Set variable"
    },
    {
      "Id": "3",
      "Type": "transform",
      "Label": "Lag melding",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "SuccessTransition": "4",
      "ErrorTransition": "",
      "Config": {
        "TargetVariableName": "TimelineMessage",
        "TargetVariableType": "str_map",
        "IsTargetVariableGlobal": false,
        "IsTargetVariableInMemory": true,
        "TransformType": "template",
        "Rtype": "var",
        "IsRVariableGlobal": false,
        "IsLVariableGlobal": false,
        "Expression": "",
        "RValue": {
          "ValueType": "int",
          "Value": 0
        },
        "RVariableName": "",
        "LVariableName": "TimelineVariabel",
        "ValueMapping": [],
        "XPathMapping": [],
        "Template": "{\r\n    \"message_en\": \"This is a {{.Variable}}\",\r\n    \"message_no\": \"Dette er en {{.Variable}}\",\r\n    \"sender\": \"Trond\"\r\n}"
      },
      "Ui": {
        "x": 646,
        "y": 141,
        "nodeType": ""
      },
      "TypeAlias": "Transform"
    },
    {
      "Id": "4",
      "Type": "action",
      "Label": "Publish timeline",
      "Address": "pt:j1/mt:cmd/rt:app/rn:time_owl/ad:1",
      "Service": "time_owl",
      "ServiceInterface": "cmd.timeline.set",
      "SuccessTransition": "",
      "ErrorTransition": "",
      "Config": {
        "VariableName": "TimelineMessage",
        "IsVariableGlobal": false,
        "Props": {},
        "RegisterAsVirtualService": false,
        "VirtualServiceGroup": "",
        "VirtualServiceProps": {},
        "DefaultValue": {
          "Value": {
            "message_en": "",
            "message_no": "",
            "sender": "flow"
          },
          "ValueType": "str_map"
        },
        "VariableType": "str_map"
      },
      "Ui": {
        "x": 983,
        "y": 264,
        "nodeType": "timeline_action"
      },
      "TypeAlias": "Timeline"
    }
  ],
  "Settings": null,
  "IsDisabled": false,
  "IsDefault": false,
  "ParallelExecution": ""
}

Her er demo for variabel i pushmelding:

{
  "Id": "orfDdHUNXhKxxUm",
  "ClassId": "orfDdHUNXhKxxUm",
  "Author": "",
  "Version": 0,
  "CreatedAt": "2023-08-19T11:44:55.648540878+02:00",
  "UpdatedAt": "2023-08-19T12:08:47.460712245+02:00",
  "Name": "Variabel til push",
  "Group": "Test",
  "Description": "Variabel til push",
  "Nodes": [
    {
      "Id": "1",
      "Type": "trigger",
      "Label": "no label",
      "SuccessTransition": "2",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "pt:j1/mt:evt/rt:dev/rn:zw/ad:1/sv:out_lvl_switch/ad:12_1",
      "Service": "out_lvl_switch",
      "ServiceInterface": "evt.binary.report",
      "Config": {
        "ConnectorID": "",
        "InputVariableType": "",
        "IsValueFilterEnabled": false,
        "LookupServiceNameAndLocation": false,
        "PropFilterName": "",
        "PropFilterValue": "",
        "RegisterAsVirtualService": false,
        "Timeout": 0,
        "ValueFilter": {
          "Value": null,
          "ValueType": "bool"
        },
        "ValueJPath": "",
        "ValueJPathResultType": "",
        "VirtualServiceGroup": "",
        "VirtualServiceProps": null
      },
      "Ui": {
        "nodeType": "",
        "x": 292,
        "y": 182
      },
      "TypeAlias": "Trigger"
    },
    {
      "Id": "2",
      "Type": "set_variable",
      "Label": "Variable",
      "SuccessTransition": "5",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "Config": {
        "DefaultValue": {
          "Value": "kekek",
          "ValueType": ""
        },
        "IsVariableInMemory": true,
        "Name": "PushVariable",
        "UpdateGlobal": false,
        "UpdateInputMsg": false
      },
      "Ui": {
        "nodeType": "",
        "x": 344,
        "y": 372
      },
      "TypeAlias": "Set variable"
    },
    {
      "Id": "5",
      "Type": "transform",
      "Label": "Lag meldingen",
      "SuccessTransition": "6",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "Config": {
        "Expression": "",
        "IsLVariableGlobal": false,
        "IsRVariableGlobal": false,
        "IsTargetVariableGlobal": false,
        "IsTargetVariableInMemory": true,
        "LVariableName": "PushVariable",
        "RValue": {
          "Value": 0,
          "ValueType": "int"
        },
        "RVariableName": "",
        "Rtype": "var",
        "TargetVariableName": "PushMessage",
        "TargetVariableType": "str_map",
        "Template": "{\r\n    \"EventName\": \"custom\",\r\n    \"MessageContent\": \"Dette er en {{.Variable}}\",\r\n    \"SiteId\": \"7fe610dc-3800-42e2-8853-c903f7501e15\"\r\n}\r\n",
        "TransformType": "template",
        "ValueMapping": [],
        "XPathMapping": []
      },
      "Ui": {
        "nodeType": "",
        "x": 644,
        "y": 159
      },
      "TypeAlias": "Transform"
    },
    {
      "Id": "6",
      "Type": "action",
      "Label": "Push notification",
      "SuccessTransition": "",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "pt:j1/mt:evt/rt:app/rn:kind_owl/ad:1",
      "Service": "kind-owl",
      "ServiceInterface": "evt.notification.report",
      "Config": {
        "DefaultValue": {
          "Value": {
            "EventName": "custom",
            "MessageContent": "",
            "SiteId": "7fe610dc-3800-42e2-8853-c903f7501e15"
          },
          "ValueType": "object"
        },
        "IsVariableGlobal": false,
        "Props": {},
        "RegisterAsVirtualService": false,
        "VariableName": "PushMessage",
        "VariableType": "str_map",
        "VirtualServiceGroup": "",
        "VirtualServiceProps": {}
      },
      "Ui": {
        "nodeType": "notification_action",
        "x": 965,
        "y": 268
      },
      "TypeAlias": "Notification"
    }
  ],
  "Settings": null,
  "IsDisabled": true,
  "IsDefault": false,
  "ParallelExecution": "parallel"
}

Det som ikke går helt klart frem for meg @espen er hvordan man definerer hvilket språk som skal komme ut på tidlinjen.

Nå kommer meldingen alltid på engelsk på tidslinjen. Dersom jeg setter engelsk til tom string, så kommer ingenting, selv om den norske er definert.

tips?

Skriv Norsk i begge.

Hei igjen :slight_smile:
Om jeg ikke husker helt feil nå på strak arm så er det avhengig av hvilket språk du bruker i appen. Settings → You → Personal info.