cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
taramoe Helper II
Helper II

SharePoint Get items filter query using endsWith, error 'Invalid Template'

I'm attaching to a SharePoint list.  I'm trying to query a data set with one column I want to query based on how the string ends.  I'm using endsWith and am getting an error that I haven't been able to resolve.  The query works fine until I add the 'endsWith' part.

The field MeetingDateTimeText is a text field.

 

The full expression is: 

endsWith(triggerBody()?['{MeetingDateTimeText}'],'4'
 
and I've also tried:
endsWith(Item()?['{MeetingDateTimeText}'],'4')

 

endsWith error 1.jpg

This is the error:

endsWith error 2.jpg

Ideas?

Thanks for your help.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User
Dual Super User

Re: SharePoint Get items filter query using endsWith, error 'Invalid Template'

Unfortunately, SharePoint only supports a StartsWith operation and I don't think that one is available for use with Odata queries.  You'll have to filter some other way and then filter further after you get the dataset.  Queries within Flow allow more options than odata.  This article is on Odata queries in REST with SharePoint, but the concepts are the same.

https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/use-odata-query-operations-in-sharepoint-...



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

View solution in original post

2 REPLIES 2
Highlighted
Dual Super User
Dual Super User

Re: SharePoint Get items filter query using endsWith, error 'Invalid Template'

Unfortunately, SharePoint only supports a StartsWith operation and I don't think that one is available for use with Odata queries.  You'll have to filter some other way and then filter further after you get the dataset.  Queries within Flow allow more options than odata.  This article is on Odata queries in REST with SharePoint, but the concepts are the same.

https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/use-odata-query-operations-in-sharepoint-...



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

View solution in original post

taramoe Helper II
Helper II

Re: SharePoint Get items filter query using endsWith, error 'Invalid Template'

Thank you, very helpful.

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Users online (7,711)