web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Custom Connector $filt...
Power Automate
Unanswered

Custom Connector $filter query string parameter does not work

(0) ShareShare
ReportReport
Posted on by 18

Hello experts,

 

I've just setup a custom connector. Problem I'm facing is the $filter query string parameter does not seem to be properly working.

 

During connector testing all is good, I get a 200 response, expected results. When I go to run the actual flow and pass the exact same $filter string parameter value, I get a 400 error saying the data types are not compatible, see below. Very strange that the custom connector testing does not match the actual flow when being used....is it possible some characters are being automatically escaped in the custom connector testing area but not in the actual flow? I've tried encoding, using compose variable string, etc but I'm stuck. Please help, any advice/input is welcome!

 

Testing - 200 response

Zpg613_0-1625518487840.png

Flow run - 400 response

Zpg613_1-1625518516368.png

 

Categories:
I have the same question (0)
  • murshed Profile Picture
    Microsoft Employee on at

    First, your filter seems like using an exact timestamp. Due the nature of distributed systems a match on exact timestamp may proved to be tricky. Try using a window instead or some other criteria to filter on.

     

    Secondly, can you tell us more about how you implemented $fliter in your custom connector and how is it processed in the backend? If you can explain what you are trying to do with this flow in general that will be helpful too.

     

    Thirdly, compare the differences between the test environment and prod environment. What are the difference between the two? Are the backend changes same in both prod and test? Can you make the API call using an app such as postman and get same/different results? Testing with postman can be helpful, since it will validate if you backend is returning correct results with the query or not. Once you confirm that, the only remaining thing to check is the connector itself.

     

    Hope this helps.

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION ☑️. If you find this reply helpful, please consider giving it a LIKE 👍.

  • Zpg613 Profile Picture
    18 on at

    Thanks for the response and appreciate the help.

     

    1 - So I have a test version of the API, and I used a specific DateTime in my post above to get an expected result, using Postman. I just changed the filter to a datetime window and got 6 results in the testing stage of the connector and also in Postman...but still get an error in the prod flow that the type entered is not correct.

     

    Makes me believe that the prod flow adds some extra characters or the test flow is adding something eg additional header or escaping characters.

     

    Testing Connector

    Zpg613_1-1625598094121.png

     

    Postman (same Get Request)

    Zpg613_2-1625598143151.png

     

    Prod PA flow

    Zpg613_3-1625598338058.png

     

    2 - The $filter in the connector is setup as a optional, string. Eventually I was going to use this data to return only the last records modified in the last 1 day. Not sure if I'm missing any configuration here. I left the default empty so I could pass dynamic string value.

     

    Zpg613_0-1625597801926.png

     

    3 - The setup for the connector and the flow are the same, point to same endpoint/gateway/etc and the test connection results match Postman exactly (above).

  • murshed Profile Picture
    Microsoft Employee on at

    The problem may be odata specific. Try googling for the error message. Please take a look at this see if it helps: https://stackoverflow.com/questions/62196447/odata-filter-datetimeoffset-less-that-date

     

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION ☑️. If you find this reply helpful, please consider giving it a LIKE 👍.

  • Zpg613 Profile Picture
    18 on at

    I've been struggling with exactly this, testing different odata filters to see if they work...is there some difference between the testing stage and prod flow - maybe testing stage adds some header or character I don't see?

    FYI When I try filtering on another field eg like a text field it seems to work ok. I've also tried passing the filter string first as a PA variable but I have the same issue.

     

    Thanks again for the input.

  • Zpg613 Profile Picture
    18 on at

    Still struggling with this, any ideas why the testing environment returns data properly but not in an actual flow?

  • murshed Profile Picture
    Microsoft Employee on at

    I wouldn't think the test and prod would behave differently. Are you using the same backend API for test and prod?

  • LaelLeeH Profile Picture
    91 on at

    Hi,

    Did you ever resolve this and is there a fix/work-around?  I am experiencing a very similar issue. I have built a Custom Connector and it works perfectly, both with and without query parameters inside the Connector Test feature. But when I try and run it from Power Apps, then it works fine without parameters, but as soon as I add in filter parameters it fails. Power Apps does not even report any error - it just does nothing.

     

    When I Inspect Element in the browser, I can see the error that odata is returning. It is complaining about pluses '+' in the query string either side of the 'eq' operator, which is invalidating the request.  It seems like either Power Apps or the Custom Connector is adding the '+'s before issuing the call to odata.  Is there some way I can remove them in the connector defintion?

     

    My request which works fine inside the Custom Connector Test feature:

    /Projects?$Select=Id,Name,EPS&$Filter=Name eq 'My Project'

     

    Error reported when inspecting element in the browser whilst running same call from Power Apps:

    {
    "odata.error": {
    "code": "",
    "message": {
    "lang": "en-US",
    "value": "Syntax error: character '+' is not valid at position 11 in 'ProjectName+eq+'My+Project''."
    }
    }
    }

    Any guidance appreciated.

    Regards

    Lael

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard