• Resolved huongcba

    (@huongcba)


    Hi, Can I add multiple values ??to a data tag? For example, my users have different roles: role 1, role 2, role 3. And I want to send notification to users who have at least one matching role.

    Thank you!

Viewing 1 replies (of 1 total)
  • Hello

    We do not recommend adding array data to tags. OneSignal is not currently capable of handling this data type in terms of filtering by items within the array.

    You should limit your tags to simple string and integer values.

    For instance the values you would set in the array should be the key and the value should be a 1 or true.

    It would be recommended to set the value to something more meaningful if applicable like a timestamp of when the event occurred so you can filter by time elapsed since the event or how many times the event occurred; if applicable.

    So if you wanted to tag a user with “events”: [“a”, “b”, “c”]

    You would be better off doing the “event” as the key, like: “a”: 1 where the value 1 can be a timestamp or incremented each time it occurs.

    Details in our Tags Guide: https://documentation.onesignal.com/docs/add-user-data-tags

    Let us know if you have any additional questions! Feel free to reach out to [email protected]. Thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘Data tags value’ is closed to new replies.