cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mpesant
Helper I
Helper I

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
Gristy
Resident Rockstar
Resident Rockstar

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
Gristy
Resident Rockstar
Resident Rockstar

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.

- 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'."
Gristy
Resident Rockstar
Resident Rockstar

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

You can view what I am trying to accomplish here.

 

https://youtu.be/DWb0HYHdYOg

Gristy
Resident Rockstar
Resident Rockstar

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
Super User III
Super User III

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

-Josh

Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





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
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (95,275)