- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2024 06:53 AM
I am working on a Flow in Flow Designer to send reminder emails for records that have been open after a specified amount of time. This is a custom table that is an extension of the Task table. I have a "Look Up Records" action in my code that looks up all the records meeting the criteria of needing to have a reminder email set. I then have a "For Each" action, which loops through all the records in my "Look Up Record" steps. These steps are working just fine.
The issue is with the "Send Email" action. In my custom table, there is an "Assigned To" field. The issue is that this field may not always be populated. Obviously, if I put this field in the "To" field on the "Send Email" action, it will error if any of the records have no value in "Assigned To".
There is a parent record for this custom table. In it, there is a "Lead Engineer" field that is always populated with a valid user. If the "Assigned To" field on my child record is blank, I want it sent to this "Lead Engineer". So in the "Send To" field, I drag in the "Assigned To" data pill from my record lookup step. I then go to the Data Pill in the "For Each" action, and drill down to the "Lead Engineer" field, and drag this Data Pill in the "Send To" field, so the "Send To" field contains both of these data pills, so it looks something like this:
However, it still does not work. I still get an error message saying "Email validation failed: Email has no recipients."
I did some testing, where I added the "Lead Engineer" field and the Number of the Parent record to the body of the email, and edited my criteria so it would only run for a small group of records, all of which have an "Assigned To" value. I then ran it, and it successfully created the emails. However, in the body of the email, the "Lead Engineer" and Number of the Parent record were both blank. It seems that even though I am able to drill down in the Data Pills and drag those fields into the body of my email, it is not returning those values for some strange reason.
How can I get this to work? Do I need to use a GlideRecord script to get to the Parent record instead of drilling down in the Data Pills? If so, how do I reference the values of the fields being returned in my "For Each" action in that code? Would I use something like "fd_data.trigger.current.field_name" for that?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 06:18 AM
Ah, don't I feel stupid! This was not a custom process I created, but something I inherited from someone else.
It looks like they had created some custom tables that they did not use. So I was referencing the wrong related custom table! When I pointed to the correct one, everything worked out as expected!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2024 07:37 PM
Basically it should work as you are expecting. Can you add a comma between the two data pills in the "To" field.
However it is not recommended to send emails directly via Flow Designer. Each time you have to change something like the layout, the recipients and so on, you have to change and publish your Flow again.
Check the following video for alternatives: 3 Ways to Notify with Flow Designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 04:09 AM
I can add a comma between the two data pills in the "To" field, but that still does not solve the problem (I originally tried with just the "Lead Engineer" field in that field (which is ALWAYS populated), and it was blank in every instance, causing errors.
The issue is that it the Data Pills are not working for these related fields in the parent record. They are showing blank, even when drilled down right from the data pill. Here is an example of the email output.
You can see all the fields highlighted in yellow are blank. The "Engineering Request Number" is the parent record, and that field is directly on the table I am looking up (and is always populated). The other two fields under it are available when I drill down into the "Engineering Request Number" data pill. I don't know why these fields are not showing when there are values there that can be seen when opening up the data record.
I could create a notification, but I think then I would have add script in order to do a GlideRecord record to look up the various details of the parent record. Is that correct? Where would I do that, exactly? Would I have to do a Mail Script inside of the Notification? It would be much more convenient to do this all in the Flow, instead of having to have a Flow, Notification, and Mail Script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 06:18 AM
Ah, don't I feel stupid! This was not a custom process I created, but something I inherited from someone else.
It looks like they had created some custom tables that they did not use. So I was referencing the wrong related custom table! When I pointed to the correct one, everything worked out as expected!