a week ago
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!
a week ago
Can you please show full URL including the query exactly as Workato is sending it?
a week ago
Hi @camaliontij,
Regards,
Prudvi
a week ago - last edited a week ago
This seems odd to me. Workato should be automatically URL encoding the parameters. I don't think you should be doing it manually in the input fields.
a week ago
@gary1 I'm sorry I just saw your message asking for the request. Just so we are in the same page, this is what I'm using:
Path as formula:
"https://api.businesscentral.dynamics.com/v2.0/ID/Production/api/DF/prod/v2.0/Companies(ID)/DFSPIFFDe..."{Last30Days}
Parameter:
Name: Last30Days
Value: (today - 30.days)
Type: Date
I get the same error when I try changing it to String, or date_time, or trying the formulas listed in this thread.
Which results in this error:
If I add the URL from HTTPS, it overrides base URI so it should be fine. But it seems like when I set it to formula, it adds a =\ at the beginning and \ at the end. I've also tried adding + or & between the string and formula, but all goes to the same error.
The URI is correct, if I run it without a filter it shows all records.
a week ago
Ok, this image makes things a bit clearer.
The problem is you're not passing a date or even a date string, you're literally passing the name of your variable "{Last30Days}" as a string. This needs to be fixed.
In Workato, you don't reference variables as a string, you reference them by using their data pill.
Please follow these instructions. Let us know if you run into any issues.