cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tsingh1
Regular Visitor

Odata Filter on activity entity??

Hi, I am new to flow and am having a issue trying on a list record. 

 

On the filter I need to basically only pull records when they are either a Appointment or a Phonecall. Have spent so much time trying different formats but hit a dead end. 

 

Any assistance would be appreciated. 

 

Filter Query - activitytypecode eq Phone Call or activitytypecode eq Appointment   (Didnt Work)

 

I tried the above first but flow keeps erroring. 

 

Any suggestions on the fix?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

 

Hi @Tsingh1 ,

 

Please try to configure Filter Query as follows:

66.PNG65.PNG

activitytypecode eq 'phonecall' or activitytypecode eq 'appointment'

 

Hope this helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

11 REPLIES 11
ScottShearer
Super User
Super User

@Tsingh1 

While I have very little experience with CDS, I suspect that you need single quotes around Phone Call and Approintment

i.e. 'Phone Call'

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Hi @ScottShearer - thanks for the quick reply. 

 

I already tried the single quotes - no luck unfortunately 

ManishJain
Solution Sage
Solution Sage

Hi @Tsingh1 ,

 

Use : activitytypecode eq '4210' or activitytypecode eq '4201'

Please refer to the following url to get the correct values : 

http://mscrmtechie.blogspot.com/2015/11/activity-pointer-and-activity-type-code.html

 

Thanks

v-bacao-msft
Community Support
Community Support

 

Hi @Tsingh1 ,

 

Please try to configure Filter Query as follows:

66.PNG65.PNG

activitytypecode eq 'phonecall' or activitytypecode eq 'appointment'

 

Hope this helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi - thanks for the reply. i have tried this and flow failed with below message: 

 

There is an unterminated string literal at position 55 in 'activitytypecode eq '4210' or activitytypecode eq '4201'.

thank you - this worked!. If i wanted to put in a criteria of appointments and phone calls only created in last 12 months what should I add?

Hi @Tsingh11 ,

 

Please add this : 

Microsoft.Dynamics.CRM.LastFiscalYear(PropertyName='createdon') and (activitytypecode eq 'phonecall' or activitytypecode eq 'appointment') 

 

Thanks

Hey thanks for the quick reply. I tried that and now it shows no activity records at all?

Hi @Tsingh11 ,

 

The best way for you to find out if you have records created in last year is to go to advanced find and view all the activities based on your activity type and filter for your date parameter. If you see records over there it should definitely show up in flow as well.

 

For more clarity please post your screenshot here.

 

Thanks

Hi thanks! 

 

1 last query if I may. I am pulling through a createdon date but the format is US version of MM-DD-YYYY

 

I want to change it to UK DD-MM-YY

 

I cant figure out the expresssion i should use

Hi @Tsingh11 ,

 

As long as the date is in ISO format you can use formatDateTime to format the date of your choice.

 

Thanks

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (6,007)