cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mpesant
Level: Powered On

Odata filter expression on Customer Asset

Hello Everyone,

 

I need a flow that will validate an email-subject to a customer asset name. 

 

Example : 

 

Email subject : ROUTER ABCD down.

 

I want that Flow check if ABCD is a customer asset and if it is, to open a case on the right account associated to this asset. 

 

Regards!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Odata filter expression on Customer Asset

In the trigger, you do not want to use subject filter at all for your scenario unless you are getting other email as well, if this mailbox is dedicated to these emails then you would want to process them all.

 

I do something similar to extract an ID out of the email for example my subject is something like this:

 

"subject": "Re: Travel Quote Required #5",
 
i know that the ID is the last thing in the subject, and that it has a # in front of it. This way i can do a simple expression to grab the correct value:
 
last(split(triggerBody()?['Subject'],'#')) put this in a compose and then you can use the outputs in the filter. Are you able to modify the thing sending the email so that you can grab the correct value for the filter?
 
if you list all values without a filter is the value stored in msdyn_name ? I would do this first to make sure you get the correct variable to filter on, then it should be as simple as msdyn_name eq 'ABCD'

 

View solution in original post

7 REPLIES 7
Super User
Super User

Re: Odata filter expression on Customer Asset

How far have you gotten?

 

Where are the list of equipment stored? SharePoint list?

 

You can use odata query:

 

Asset eq 'ABCD'

 

you need to grab ABCD from the subject, i suggest you format the email maybe some it has a character around it so that you know 100% you are grabbing the correct value etc.

mpesant
Level: Powered On

Re: Odata filter expression on Customer Asset

- The list of equipment is in Dynamic 365 Customer Asset

 

I would like the system to match the email subject defined field to the D365 Customer asset.

 

The Odata asset eq is not existing.

 

Result : "Could not find a property named 'asset' on type 'Microsoft.Dynamics.CRM.msdyn_customerasset'."
Super User
Super User

Re: Odata filter expression on Customer Asset

Hi,

 

I am sorry i have not done anything with D365 but, the first thing you will need to do is figure out the field name.

 

looks like perhaps it is: msdyn_name

mpesant
Level: Powered On

Re: Odata filter expression on Customer Asset

You can view what I am trying to accomplish here.

 

https://youtu.be/DWb0HYHdYOg

Super User
Super User

Re: Odata filter expression on Customer Asset

In the trigger, you do not want to use subject filter at all for your scenario unless you are getting other email as well, if this mailbox is dedicated to these emails then you would want to process them all.

 

I do something similar to extract an ID out of the email for example my subject is something like this:

 

"subject": "Re: Travel Quote Required #5",
 
i know that the ID is the last thing in the subject, and that it has a # in front of it. This way i can do a simple expression to grab the correct value:
 
last(split(triggerBody()?['Subject'],'#')) put this in a compose and then you can use the outputs in the filter. Are you able to modify the thing sending the email so that you can grab the correct value for the filter?
 
if you list all values without a filter is the value stored in msdyn_name ? I would do this first to make sure you get the correct variable to filter on, then it should be as simple as msdyn_name eq 'ABCD'

 

View solution in original post

Jcook
Level 8

Re: Odata filter expression on Customer Asset

Yep that’s what I always do. Works like a charm.

-Josh
mpesant
Level: Powered On

Re: Odata filter expression on Customer Asset

I guess it would work if my Message Id would increment and not if the subject is always the same. Since I can get the same alert 1000 time, it says "record already exist". therefor Message Id is not right But......................

 

I used your expression into my msdyn_name  expression and it works great. 

 

Thanks alot! 

 

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (3,617)