cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Issue with Date Parameter in API call filter

camaliontij
Deputy Chef I
Deputy Chef I

Hello,

 

I have an API call with a date filter and I want to get the information from the last 30 days. So I created a parameter like this:

today-30.days

and called it "Last30days". Then I added the parameter to my API call to be like this:

my_API_call_?$filter=PostingDate gt {Last30Days}

but it's not working and I'm getting the following error:

"A binary operator with incompatible types was detected. Found operand types 'Edm.Date' and 'Edm.String' for operator kind 'GreaterThan'."

Any idea on what would be the right way to do this?

Thanks!

23 REPLIES 23

gary1
Executive Chef III
Executive Chef III

Thanks for all of the screenshots and details. Here are my thoughts:

  1. Ditch the formula approach. This looks very incorrect/buggy.
  2. Ignore the URL preview. It will never show the value of the variable because that is only determined at run time. You might also want to try to ditch the variable entirely and work with a hardcoded date like "2025-01-01" for now. You can switch back to the variable after the bigger issues are ironed out.
  3. The text approach looks great, but why are you switching back to guided setup? What happens if you don't switch back to guided setup?
  4. Can you post a screenshot of the "Request" tab from the text approach error? Your screenshot above shows the response tab, but I'm curious to see how the outbound request was formatted.

#4 is the most important because this is the last bit of important information that I don't have.

@gary1 I thought the guided setup was the right way to change something and validate it right away but apparently, it doesn't support everything that was causing the problem.

I've updated the PATH to Text + the Last 30 days parameter from the data pill and didn't change it to Guided Setup for Validation. I've activated the recipe and it ran.

I will spend some time today to validate it and make the change to the other recipes, if it works I will provide another update here.

Thank you!

Prudvi
Executive Chef I
Executive Chef I

Thanks @gary1.
Regards,
Prudvi

camaliontij
Deputy Chef I
Deputy Chef I

Hey guys, just to update you on this, it's solved!

The issue was that I was using the guided setup to validate the data resulting from the API call which I believe is the only way to see that data. The thing is, the guided setup doesn't support data pills so that was causing the issue.

So I added the PATH as >>>>> my_API_call_?$filter=PostingDate gt {Last30Days data pill}
Set it as Text (not formula) and that worked.

Thank you very much for the support!