Skip to main content
Solved

How to filter Get Request?

  • November 9, 2022
  • 9 replies
  • 1018 views

hhy38
Superhero (Customer)
Forum|alt.badge.img+16
  • Superhero (Customer)
  • 326 replies

Hi,

I am trying to filter results with the query option. I tried many combinations but, I could not handle it. Get request gives an error. The error is "The types 'IfsApp.EmployeesHandling.EmploymentTypeState' and 'Edm.String' are not compatible.". How can I filter result?

 

 

 

The Error:

 

Best answer by ChristianJ

Hi @hhy38,

 

You can try with:

/main/ifsapplications/projection/v1/EmployeesHandling.svc/Reference_LovEmploymentType?$filter=Objstate%20eq%20IfsApp.EmployeesHandling.EmploymentTypeState%27Active%27

 

Best Regards,

Christian

9 replies

Forum|alt.badge.img+5
  • Do Gooder (Employee)
  • 20 replies
  • Answer
  • November 9, 2022

Hi @hhy38,

 

You can try with:

/main/ifsapplications/projection/v1/EmployeesHandling.svc/Reference_LovEmploymentType?$filter=Objstate%20eq%20IfsApp.EmployeesHandling.EmploymentTypeState%27Active%27

 

Best Regards,

Christian


hhy38
Superhero (Customer)
Forum|alt.badge.img+16
  • Author
  • Superhero (Customer)
  • 326 replies
  • November 10, 2022

Thank you @ChristianJ,

It is working. What is the best practice to find  ‘IfsApp.EmployeesHandling.EmploymentTypeState’ part of filtering? 

 


  • Superhero (Employee)
  • 1487 replies
  • November 10, 2022

Thank you @ChristianJ,

It is working. What is the best practice to find  ‘IfsApp.EmployeesHandling.EmploymentTypeState’ part of filtering? 

 

Easiest way is to apply the filter in the screen itself and then pick it up from the URL or Chrome Dev Tools. You can also look at the API from the API explorer, or use /main/ifsapplications/projection/v1/EmployeesHandling.svc/$openapi?V3 

 

EmploymentTypeState_Enumeration":{"type":"string","enum":["Active","Hidden","Blocked"]}

 


hhy38
Superhero (Customer)
Forum|alt.badge.img+16
  • Author
  • Superhero (Customer)
  • 326 replies
  • November 10, 2022

Thank you @anmise. I think I could not tell. Usually, we are using in the filter expression (coloumn eq ‘value’). When it comes to objstate it is different. You have to use the expression as (Objstate eq IfsApp.handling   state’state value’).  

 

 

To find this expression. I am using the first expression. Then, I am getting the error. Then I extract the ‘IfsApp.handling’ part to use the filter.

 

 

 

Forum|alt.badge.img+11
  • Hero (Customer)
  • 132 replies
  • September 20, 2023

Hi guys,

I am having trouble to pass a state as parameter to my API, even when I use like you told. Follow the error message:

 

Thanks,

Gianni


hhy38
Superhero (Customer)
Forum|alt.badge.img+16
  • Author
  • Superhero (Customer)
  • 326 replies
  • September 20, 2023

Hi @gianni.neves,

 

Can you show your filter and the URL?


Forum|alt.badge.img+11
  • Hero (Customer)
  • 132 replies
  • September 20, 2023

Hi @gianni.neves,

 

Can you show your filter and the URL?

Thanks for the quick answer

 

 


Forum|alt.badge.img+11
  • Hero (Customer)
  • 132 replies
  • September 20, 2023

Hi @gianni.neves,

 

Can you show your filter and the URL?

Thanks for the quick answer

 

 

Thanks @hhy38, I found the solution.


hhy38
Superhero (Customer)
Forum|alt.badge.img+16
  • Author
  • Superhero (Customer)
  • 326 replies
  • September 20, 2023

@gianni.neves Very nice! You are welcome.