cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Change reply email's owner to match original email's owner

Hello all,

 

Background: In our customer support center we email people using the Dynamics CRM, but when they reply to those emails, it goes to a general queue. Instead of that, if when they replied, it was automatically assigned to the support agent who originally sent the email that the customer is replying to, that would speed up the process a lot.

 

So,

I'm trying to build an automated flow in the Common Data Service that will change the owner of any email that is a reply to match the owner of the parent email. I am pretty sure the first 90% of the flow is working correctly, and that the problem is just the last part, but I will show the whole flow. Please help me know what to change to make it work. 

Email Flow 01.JPG

The first condition is saying that if the direction is incoming, and the second condition is saying that if the parent activity id contains data, then it will get a record. Entity name is email messages, and item ID is the parent activity id of the 'when a record is created' email message. 

Email Flow 02.JPG

After the 'get a record' step, I set it to list records. Entity name: Users. Filter Query: systemuserid eq 'Owner(Value)'. (the owner value of the 'get a record''s email message.) and the Top Count is set to 1 because there is only one owner of the parent email.

Email Flow 03.JPG

Then I inserted the 'update a record' step. I specified the entity that I wanted to change (Email Messages) and for the item ID I just put the 'when a record is created' email message.

Email Flow 04.JPG

This step is where I start getting the errors. I open the advanced options and scroll down to 'Owner (Owners)' row since that's what I want to change, and I've tried several different things in this field, all of which come back with errors. The most recent attempt I tried putting an item expression. here's the exact text:

item()?['ItemIndernalId']

I followed this other post:  https://powerusers.microsoft.com/t5/Building-Flows/Simple-flow-for-CDS-How-to-update-owner/td-p/5729...

Email Flow 05.JPG

Lastly, here's a picture of the error I'm getting. Since it says there's a null value, I would guess I need to add something to the 

item()?['ItemIndernalId'] text, but I have no idea what I need to add. Anyone's help would be greatly appreciated!
 
- Stephen
1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Figured it out.

 

All I edited was after the "List Records" I put a 2nd "Get a record" step and selected the entity name of users and in the "Item ID" field I made this expression:    

first(outputs('List_records')?['body/value'])['systemuserid']
Then created a "Update a record" step as seen below:
Email Flow 06.JPG
Next in the owner field of the "Update a record" step I put this :       /systemusers(@{outputs('Get_a_record_2')?['body/systemuserid']}) as seen below:
Email Flow 07.JPG
Once I saved those changes it worked. Every reply email is being automatically assigned to the agent who sent the original.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Figured it out.

 

All I edited was after the "List Records" I put a 2nd "Get a record" step and selected the entity name of users and in the "Item ID" field I made this expression:    

first(outputs('List_records')?['body/value'])['systemuserid']
Then created a "Update a record" step as seen below:
Email Flow 06.JPG
Next in the owner field of the "Update a record" step I put this :       /systemusers(@{outputs('Get_a_record_2')?['body/systemuserid']}) as seen below:
Email Flow 07.JPG
Once I saved those changes it worked. Every reply email is being automatically assigned to the agent who sent the original.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (2,859)