Push Notification - Failed: Error: No Notification was created because 'To' is missing or invalid

Debugging a reported problem in an app I have two push notifications.  When they are executed in test this one fails:

 

 

{
  "$type": "Nirvana.Data.TaskResultNotification, V2API",
  "Body": "Sorry, you just missed out on job: \"Test Job\" ",
  "Icon": null,
  "NotificationAction": {
    "$type": "MobileNotificationsData.DeepLinkNotificationData, MobileNotificationsData",
    "isNotification": "true",
    "hashState": "#control=New%20Jobs&at=04%2F09%2F2024%2018%3A23%3A15",
    "appGuid": "3e5d4921-506d-45a4-8672-5722452cb813",
    "ashost": null,
    "name": "DEEP_LINK"
  },
  "Title": "Missed out on Job",
  "To": [
    "recipient@test.com"
  ],
  "AppErrors": {
    "$type": "Jeenee.DataTypes.AppErrors, Jeenee.DataTypes",
    "RecordInfo": false,
    "RecordWarning": true,
    "AnnotateErrors": false,
    "Errors": []
  },
  "TaskType": "Notification",
  "TaskName": "Task for Notify Loss"
}

 

 

This one on another path succeeds:

 

 

{
  "$type": "Nirvana.Data.TaskResultNotification, V2API",
  "Body": "\"Test Job\" Accepted by recipient. Click to view more details",
  "Icon": null,
  "NotificationAction": {
    "$type": "MobileNotificationsData.DeepLinkNotificationData, MobileNotificationsData",
    "isNotification": "true",
    "hashState": "#control=Job_Detail&row=1f83d3e9&at=04%2F09%2F2024%2018%3A23%3A15",
    "appGuid": "3e5d4921-506d-45a4-8672-5722452cb813",
    "ashost": null,
    "name": "DEEP_LINK"
  },
  "Title": "Accepted Job",
  "To": [
    "recipeint@test.com",
    "m+F+F+@test.com",
    "info@test.com",
    "l@test.com"
  ],
  "AppErrors": {
    "$type": "Jeenee.DataTypes.AppErrors, Jeenee.DataTypes",
    "RecordInfo": false,
    "RecordWarning": true,
    "AnnotateErrors": false,
    "Errors": []
  },
  "TaskType": "Notification",
  "TaskName": "Task for Notify Acceptance"
}

 

Here are the basic settings for the notification:

MattJP_0-1712597931898.png

 The interesting thing and the thing I need help with is that recipient@test.com.au  (not the real address) receives nothing for the first notification but receives fine for the second.

I'd appreciate any insights.

Matt P

Solved Solved
0 2 62
1 ACCEPTED SOLUTION

Hello there,

You can't use USEREMAIL() in the "To" section for a bot, the bot evaluates the data from the perspective of the AppSheet back end, it only has access to the data that was actually written to your app, it isn't being run from the users device, so it doesn't know who the current user is, or what is it's email.

Instead of using USEREMAIL() there, add a column in that table with an initial value of USEREMAIL(), and then use THAT column in your "To" parameter, and it should work.

View solution in original post

2 REPLIES 2

Hello there,

You can't use USEREMAIL() in the "To" section for a bot, the bot evaluates the data from the perspective of the AppSheet back end, it only has access to the data that was actually written to your app, it isn't being run from the users device, so it doesn't know who the current user is, or what is it's email.

Instead of using USEREMAIL() there, add a column in that table with an initial value of USEREMAIL(), and then use THAT column in your "To" parameter, and it should work.

It would be helpful if it didn't put a value in the to field or errored in the expression evaluation.  Thanks very much for the information.

Top Labels in this Space