Skip to main content
Question

REST API Generic Inquiry Filter. "Input string was not in a correct format


Forum|alt.badge.img

Hi Everyone,

Have an issue with filtering a GI through the REST API.

Below is the setup for my endpoint filter.

And this is my request body

I’m getting the below error 

If I send a word like “test” instead of the actual ID then there is no error however if I send a number formatted as a string then it isn’t happy.

Has anyone seen this before / know a fix?

Naveen Boga
Captain II
Forum|alt.badge.img+19

@matthewgerdan I understand that you provided the StringValue in the endpoint but can you please also let us know what is the datatye that you mentioned in the code level?

I’m assuming that the code level and data type were different, hence you are getting this issue.


Forum|alt.badge.img
Naveen Boga wrote:

@matthewgerdan I understand that you provided the StringValue in the endpoint but can you please also let us know what is the datatye that you mentioned in the code level?

I’m assuming that the code level and data type were different, hence you are getting this issue.

Hi @Naveen Boga I've included screenshots of the DAC, GI Parameter and table schema, they are all set up as strings, this field is a key field so I’m not sure if that might be causing an issue.

 


Naveen Boga
Captain II
Forum|alt.badge.img+19

@matthewgerdan  This is wired !!

All looks good to me except that field INPUT MASK, you provided 99999…., which can allow only digits. Can you please change this input mask and verify?

 


Forum|alt.badge.img

@Naveen Boga No Luck ☹️

 


Naveen Boga
Captain II
Forum|alt.badge.img+19

@matthewgerdan Okay!!

Can you please share the GI?


Forum|alt.badge.img

@Naveen Boga I’ve attached the RPX as XML is this what you needed?


Naveen Boga
Captain II
Forum|alt.badge.img+19

@matthewgerdan I was not able to import this GI for some reason and getting below error.

 


Forum|alt.badge.img

@Naveen Boga It won’t let me upload it in RPX however the GI is using a customer table 

 


Naveen Boga
Captain II
Forum|alt.badge.img+19

@matthewgerdan Thanks for sharing the screenshots here and all looks good.

Do you have any logic implemented in the graph and assigning values?


Forum|alt.badge.img

@Naveen Boga Nah the graph only contains a couple views 

 


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • January 15, 2024

Hi @matthewgerdan were you able to find a solution? Thank you!


Forum|alt.badge.img

@Chris Hackett Unfortunately, no.

I’m pretty sure that it has something to do with the field being filtered being a key field, I have another request that also passes a number as a string and has no issue however in that case the field is not a key.


bryanb39
Pro II
Forum|alt.badge.img+5
  • Pro II
  • January 17, 2024

Are there more than one result using that ID?  If it's a key field it is expecting a single response.  If you send "123" does it give the same error? 


Forum|alt.badge.img

Hi @bryanb39, using 123 instead of an actual number worked however all the keys in the DB are unique.

 


Troy Vars
Semi-Pro I
Forum|alt.badge.img+2
  • Semi-Pro I
  • January 25, 2024

A couple of ideas

Could this be a naming convention issue I notice your Field Name for the table is ShopifyLocationID and the name of the Parameter for your GI that is used in the condition is also ShopifyLocationID… could it be getting confused?

By that I mean how is the Parameter vs the Field Identified in your Endpoint Mapping (I see in the first screen shot the parameter declared as the Filter but can’t see any more than the “Shopify Location ID” in the Mapped Field)…

I would try renaming this filter/remapping endpoint and see if you have the same issues…

The other option is I noticed you have this exposed via oData you could try filtering it in the URL parameter call and see if you get a similar error there, might give us a different error message to try to help find the issue...


Forum|alt.badge.img

Hi there,

I am working with the Rest API and ODATA4. to pull data from Acumatica.

The query syntax allows for the inclusion of a $filter parameter in the REST query to limit the data returned.

In the video presentations I can see a few of the comparisons supported: eq for equal, and I think that it does gt and lt for greater than less than etc - but I’m wondering if there’s some comprehensive documentation anywhere that would describe all the different types of filtering you could do for example “in” (as like a sql “in” statement) would be very useful. A search on the website didn’t reveal anything.

Many thanks in advance,

Daniel Graham


Troy Vars
Semi-Pro I
Forum|alt.badge.img+2
  • Semi-Pro I
  • February 28, 2024

Forum|alt.badge.img

Thanks very much for this - that’s hugely helpful.

Daniel Graham


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings