web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Send a survey when a c...
Power Automate
Unanswered

Send a survey when a case is resolved in Dynamics 365

(0) ShareShare
ReportReport
Posted on by 15

Hi,

 

I need to send out an email with a survey link (Forms Pro) to a specific list of contacts every time a case is closed in our Dynamics 365 CRM.

 

The situation is a little bit tricky because the "case" entity is not directly related to the "contact" entity in our case (please see the screenshot below):

– the case has a window in the bottom right corner, that lists the project members (which is another entity)
– when I click on the name of a project member a new window opens up. Here we can see the name (lookup field to the contact), the role, and other information.
– when I click on the name of the project member, then I am directed to the contact itself. (Here I need to target the email address)

 

When-case-is-resolved-list-records.jpg

Link to the screenshot: https://ibb.co/7tzVx3Z

 

Based on the scenario, I tried to build a flow, and at the end list the contact's first name in an excel sheet, in order to see if the flow is working correctly and listing the right contacts. (Later, instead of adding the contacts to an excel sheet, I will create the survey invite)

 

Unfortunately, I received an error at the List step:

Syntax error at position 36 in '_parentcustomerid_value eq ORD-01379-V0X9Z4'.

 

Any help would be greatly appreciated!

 

Thank you,

Csaba

Categories:
I have the same question (0)
  • Ed Gonzales Profile Picture
    4,531 Most Valuable Professional on at

    @Csaba 

    Hi there!  Neat idea, but I have a couple of questions:

    It's difficult to zoom in all the way, but it looks like I can have multiple Project Members for each Project, is that correct?

    If so, what is the intent in that case?  One suggestion might be to identify a "Main Contact" for each project to make that a 1:1 (thus making it easier to know who to send the email survey to)...OR have the person closing the project select a single contact as part of the resolution process.

     

    Another note:  You can probably do all of this from within D365, if you want to.

     

    Either way, keep us posted.  This is a great 'customer journey' and will be pretty awesome when you're finished.

    -Ed-

     

    If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

  • Csaba Profile Picture
    15 on at

    Hi @edgonzales ,

     

    Thank you for your reply.

    Please use the link in order to zoom in: https://i.ibb.co/Wv3FNrM/When-case-is-resolved-list-records.jpg

     

    Yes, a project can have multiple project members. These members can be internal (employees of the company) or external (clients we are working with). Whenever a project (case) is closed, I would like to send an email to every external project member. This email should include a link to a satisfaction survey (I use Microsoft Forms Pro). In short, we would like to ask for their feedback, how was their experience with us.

     

    • identifying the main contact would be easy, however, this is not how we want to do it, because the main contact is an account entity. Therefore I think we are dealing with a 1:N relationship instead. 
    • selecting a single contact it's not a solution either, because it requires a manual step, but we want to automate the process. In addition, most of the case there will be multiple contacts (external project members), not only one.
    • Doing the whole process in D365 could be also an option, but I am not sure how to. It was possible with Voice of the Customer, however, Microsoft decided to shut it down, and focus on Microsoft Forms, as the primary tool for surveys. Using Microsoft Flow it's easy to create a survey invite via email, that is unique for each respondent. 

     

    Best,

    Csaba

  • Ed Gonzales Profile Picture
    4,531 Most Valuable Professional on at

    Ok, that makes sense - And thanks for the bigger image, that helped a lot!

     

    One thing you might consider is appending the contact emails to a string variable inside your Apply to each loop (just before or instead of the spreadsheet step).  Then sending the survey to the variable.   Back to your error...

     

    So, parentcustomerid_value is the thing connecting the Contacts to the Project Member, probably right?  Does the field actually have a leading underscore?  If I'm reading things right, is it trying to match that value to the Case ID?  I wonder if there's a different field connecting the Project Members to the Case.  I also might expect something that looks more like a GUID than a case number ('ORD-01379-V0X9Z4').  Can you verify the relationship between the two is indeed that _parentcustomerid_value field?

     

    Thanks!

    -Ed-

  • Csaba Profile Picture
    15 on at

    Hi @edgonzales ,

     

    So, parentcustomerid_value is the thing connecting the Contacts to the Project Member, probably right?

    • No. At the List records step, I try to first list all project members that are connected to the particular case. Then in the Get record step, I try to get all the contacts that are connected to the project member entity that I listed in the previous step. Does it make sense?

    Does the field actually have a leading underscore?

    • I am not sure. I found this filter query here. I tried to adopt, however, I didn't find any proof that connection is parent/child relationships. 

    If I'm reading things right, is it trying to match that value to the Case ID?

    • Yes, I try to match that value to the case ID. In other words, I try to match the project member to that particular case. 

    I wonder if there's a different field connecting the Project Members to the Case.  I also might expect something that looks more like a GUID than a case number ('ORD-01379-V0X9Z4').  Can you verify the relationship between the two is indeed that _parentcustomerid_value field?

    • I checked the case entity and has a 1:n relationship with the project member entity. (The project member entity has a n:1 relationship to the case). project to project member.png
      "Auftrag" = case
      "Projektmitglied" = project member
    • The field that connects to 2 entities is asc_salesorder_asc_projektmitglied_Auftrag. Can I use this field in the filter query to match the case to the project member?
    • I also checked the contact entity and has a 1:n relationship with the project member entity. (The project member entity has a n:1 relationship to the  contact). 

    Best,

    Csaba

  • Verified answer
    Csaba Profile Picture
    15 on at

    I found the solution!

     

    Csaba_0-1572430366278.png

     

    1. List project members:
      In order to connect the case with the project members, I checked the ids of both entities. In my case:
      _asc_auftrag_value eq @{triggerBody()?['salesorderid']} 
    2. I had the filter out only the external project members. There is a lookup field for externals and another for internals, therefore I checked if the external field is populated (If yes, good to go. It cannot be internal and external at the same time):
      _asc_externeressource_value ne null
    3. Get the contacts that are connected to the project member entity. 
      The item identifier is the field that I previously used to check for external project members: asc_externeressource

    @edgonzales Thanks for your help. Your questions guided me in the right direction.

     

    Best,

    Csaba

  • JB-02091416-0 Profile Picture
    4 on at

    Hi @Csaba ,

    What are the values that you have used in the "Condition" section.

    I have checked the link to the images but still find it difficult to see all the details, can you provide the images as standalone?

    Thanks in advance for your response.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard