Ask Search:
Stefan MaierStefan Maier 

Flows: What is the correct data type for Recipient ID in Send Custom Notification Action

Hi,

I am trying to create an Autolaunched Flow that sends out Custom Notifications. I am struggling with defining the correct Recipient ID. Assuming a User ID is required, I assigned my own User ID to a variable and entered that in the respective field of the Flow Action.

However, I am receiving the error message: "The data type of the resource you entered isn't compatible."

As I cannot find any proper documentation on this, is there anybody who can help me solve this, i.e. tell me what data type is needed here?

Thanks!
Stefan
​​​​​​​User-added image
 
Best Answer chosen by Jayson (salesforce.com) 
Tajinder SinghTajinder Singh

Hi ,
Found this topic while looking for CustomNotificationType

It's possible to use  new flow builder intead of cloud flow designer. Dont think it's a bug.  Recipient IDs field  expects a list of Id's.  You can create a variable with datatype text and checkbox "Allow multiple values (collection)". 

With Assign you can add recipients (user id's) to it.  In the Recipient Ids field refer the variable.

All Answers

Luke PotterLuke Potter
Hi Stefan, 

May be a shot in the dark but I think it's expecting an email? - Try and see if you get the same error. 

Luke
Stefan MaierStefan Maier
Thanks Luke! No luck, though. Same error. Regards, Stefan
Luke PotterLuke Potter
Ahh! Perhaps a ContactId? 
Stefan MaierStefan Maier
Same error :-(
Luke PotterLuke Potter
Ok :(

Which action are you using within the flow? and what're you trying to make it send? is it an email? - To me it makes sense to be the email addresses of the recipients which it usally is. How're you setting the variable for the email addres?

Luke
Stefan MaierStefan Maier
I am trying to send a Custom Notification through the Action "Send Custom Notification" (customNotificationAction) - for testing purposes, I am trying to create a Flow that sends a notification to ANY user (e.g. me), so my understanding is that the recipient ID should be a UserID. I can do the same using Process Builder and there it works.
Luke PotterLuke Potter
I see, you're correct, it should be a UserId.. what is set at the data type within your variable? 
User-added image
Stefan MaierStefan Maier
Hi Luke, the Variable is of Data Type "Record", Object "User", exactly as in your posted picture. Did you manage to send (or even only save) a notification action?
Luke PotterLuke Potter
Hi Stefan,

I think you will need to open a Case with SF regarding this. As it's a new feature of Summer 19 I think this could be a bug. I've spent the last 40 minutes trying to get around it myself but to no avail! You should be able to give it your User variable. Sorry I couldn't help.. let me know if you get anywhere. 

Luke
Stefan MaierStefan Maier
Luke,
Thanks for supporting me with this. I opened a Case with SF and will keep you posted when I have a solution.
Cheers, Stefan
Arianne Mae CruzArianne Mae Cruz
Hi Stefan, I think what you want is to send an email notif right? I don't think that action would work (https://help.salesforce.com/articleView?id=platform_events.htm&type=5).

I think your option is to change the action type to email alert(under type) or just select Email (under Category) instead.
Stefan MaierStefan Maier
No, I am NOT trying to send an email, but a CUSTOM notification (so-called bell notification - configurable as a new feature in release Summer '19)
Stefan MaierStefan Maier
Hi,
Salesforce Partner Support just sent me the following message:

"[...] After troubleshoot, I have found that the issue you are facing is a bug on the Salesforce platform. Unfortunately, there is no work-round at the moment. I apologize for the inconvenience. [...]"

I will keep you guys posted once I receive any news.
Regards, Stefan
Luke PotterLuke Potter
Thanks for the update Stefan,good and bad news I guess! at least we weren't going crazy.. hopefully it gets resolved soon. 

Luke
Stefan MaierStefan Maier
Salesforce Support recommended to use Cloud Flow Designer instead of the new Flow Builder, and indeed I was able to at least save and run the Flow.
Apparently, for Recipient IDs, a collection variable is required.
What I am struggling with now: The system asks for the Custom Notification Type ID. I know well where and how I can create Notification Types, but there are no IDs visible, neither in the UI nor the address line in the browser. Any ideas?

Notification Types
Gidi AbramovichGidi Abramovich
@Stefan Maier Hi,
I am facing the same problems. 
I hope Salesforce will resolve it ASAP.

Best Regards,
Gidi
Stefan MaierStefan Maier
Hi Gidi,
I actually managed to create a basic flow. What exactly are you struggling with? maybe I can be of help.
Stefan
Gidi AbramovichGidi Abramovich
Hi Stefan,
How did you retrieve the Type Id? 

Thanks,
Gidi
Stefan MaierStefan Maier
Hi Gidi, You would have to use the Workbench. After login, go to '/services/data/v46.0/tooling/query?q=select+id+from+CustomNotificationType’ and you will see the id of your Notification Type(s). Good luck! Stefan
Gidi AbramovichGidi Abramovich
Great, I'll give it a try, thanks for your help!
Trevore MeyerTrevore Meyer
Hi Stefan!

I've logged into Workbench (workbench.developerforce.com) and suffixed the link you provided but that doesn't seem to do the trick. Any other pointers you might be able to give me? Thanks so much!
Stefan MaierStefan Maier
Hi Trevore, try the following: After logging in to Workbench, go to Info -> Metadata Types & Components, then choose CustomNotificationType from the dropdown menu. Under Components, you should see all Custom Notification Types for your org including the IDs. Hope that helps! Stefan
Tajinder SinghTajinder Singh

Hi ,
Found this topic while looking for CustomNotificationType

It's possible to use  new flow builder intead of cloud flow designer. Dont think it's a bug.  Recipient IDs field  expects a list of Id's.  You can create a variable with datatype text and checkbox "Allow multiple values (collection)". 

With Assign you can add recipients (user id's) to it.  In the Recipient Ids field refer the variable.

This was selected as the best answer
Trevore MeyerTrevore Meyer
Ah Ha! Thanks Tajinder! That finally worked for me. 
Gidi AbramovichGidi Abramovich
Hi Everyone,
@Narender Singh wrote an article (https://forcepanda.wordpress.com/2019/07/02/how-to-get-the-id-of-custom-notification-types-in-salesforce/) on how to get the Id of the Custom Notification Types.
I thought it might be useful.

Best Regards,
Gidi
Toan Nguyen DucToan Nguyen Duc
Hi,
I'm trying to create the same flow like you guys did but I cannot save it. Is there anything wrong here?

User-added imageUser-added image
Trevore MeyerTrevore Meyer

Looks to me like you're trying to kick out a notification for a chatter post. But I'm not seeing a Get Records step anywhere for PB to get going from. Also, Recipient IDs needs to be a Record Collection variable. In my instance, I had to create a separate step for the assignment. Beyond the links and mentions above in this thread, take a look at these SF Admin videos on YouTube: https://youtu.be/_UC9uMVxECc . This is a multipart series that should walk you through most of the steup.

Claire JonesClaire Jones
@Tajinder Singh +100000
Your answer helped me work out what needs to be put in the Recipient IDs field - a Collection of Text Strings.
For those who cannot see his answer above:

Recipient IDs field expects a list of Id's. 
You can create a variable with datatype text and checkbox "Allow multiple values (collection)"