API search on custom field and value

Posts about the simPRO API. Help/support/how-to etc.
Forum rules
  • Check the documentation first. Before posting questions, please check the documentation to ensure it doesn't already cover what you need.
  • No spam. All automated messages, advertisements, and links to competitor websites will be deleted immediately.
  • Post in relevant sub-forums only. Messages posted in the wrong topic area will be removed and placed in the correct sub-forum by moderators.
  • Respect other users. No flaming or abusing fellow forum members. Users who continue to post inflammatory, abusive comments will be deleted from the forum after two warnings are issued by moderators.
  • Harassment. No threats or harassment of other users will be tolerated. Any instance of threatening or harassing behavior is grounds for deletion from the forums.
  • Adult content. No profanity or pornography is allowed. Posts containing adult material will be deleted.
  • Bandwidth. All images and signatures must be 500 x 500 pixels or smaller. Posts containing over-sized images and signatures will be removed.
  • Illegal content. No re-posting of copyrighted materials or other illegal content is allowed. Any posts containing illegal content or copyrighted materials will be deleted.
Post Reply
User avatar
cit
Posts: 24
Joined: Tue Apr 28, 2020 12:51 pm
Location: Milton Keynes, UK
Contact:

API search on custom field and value

Post by cit » Tue Aug 20, 2024 12:24 pm

Hi,

We are using the API search functionality to get jobs where a custom field has a specific value. This has been working for at least a year, but seems to have stopped working over the last few days/week.

This is the query we are using:

/companies/0/jobs/?Stage=in(Complete,Archived)&CustomFields.CustomField.ID=35&CustomFields.Value=Yes&columns=ID

The combination of CustomFields.CustomField.ID=35&CustomFields.Value=Yes was suggested in a previous post here to get it working in the first place.

If I query a specific job that it should return I can see the custom field ID and value match the filter but it's not returned in the above query.

[
{
"ID": 65125,
"CustomFields": [
{
"CustomField": {
"ID": 35,
"Name": "Approved",
"Type": "List",
"IsMandatory": false,
"ListItems": [
"Yes",
"No",
"Sent"
]
},
"Value": "Yes"
}
]
}
]

Any idea why this is no longer working?

Thanks,
Duncan
Confidence IT Ltd
https://confidenceit.co.uk

IT SUPPORT | TELECOMS | HOSTING | CYBER SECURITY | AUTOMATION
SimproAPITeam
Posts: 831
Joined: Wed May 01, 2024 2:31 am

Re: API search on custom field and value

Post by SimproAPITeam » Wed Aug 21, 2024 4:29 am

Hi Duncan,
We have identified an issue with the search when there are more than 30 custom fields on the project as an example.
Would this be the case in your instance?

Regards
Simpro API Team | Simpro Software Group
User avatar
cit
Posts: 24
Joined: Tue Apr 28, 2020 12:51 pm
Location: Milton Keynes, UK
Contact:

Re: API search on custom field and value

Post by cit » Wed Aug 21, 2024 10:53 am

Hi,

Thanks for the suggestion. We have 21 custom fields in the "Leads, Quotes, Jobs & Recurring Custom Fields" section so that shouldn't be the issue for us.

Strangely it is working for some jobs, but not all. Is there a combination of custom field values that might impact it? We have several null values for instance, and various dates, lists, and text.

Thanks,
Duncan
Confidence IT Ltd
https://confidenceit.co.uk

IT SUPPORT | TELECOMS | HOSTING | CYBER SECURITY | AUTOMATION
SimproAPITeam
Posts: 831
Joined: Wed May 01, 2024 2:31 am

Re: API search on custom field and value

Post by SimproAPITeam » Wed Aug 21, 2024 10:54 pm

Hi again,
I've recreated the test data that you mention and I was able to get the correct search results with the parameters you have included in your URL.

I would expect your query to work correctly. What results do you get, is it an empty array or an error message.

Double check your data and see how you go. If it's still not working send us a private message with your build details and specific examples of jobs you would expect in return and we can have a quick look.

Regards
Simpro API Team | Simpro Software Group
User avatar
cit
Posts: 24
Joined: Tue Apr 28, 2020 12:51 pm
Location: Milton Keynes, UK
Contact:

Re: API search on custom field and value

Post by cit » Thu Aug 22, 2024 9:58 am

Thanks again for the reply. I've send a PM as requested.

Duncan
Confidence IT Ltd
https://confidenceit.co.uk

IT SUPPORT | TELECOMS | HOSTING | CYBER SECURITY | AUTOMATION
SimproAPITeam
Posts: 831
Joined: Wed May 01, 2024 2:31 am

Re: API search on custom field and value

Post by SimproAPITeam » Tue Aug 27, 2024 12:38 am

Hi Duncan,
We have released an update that should solve the issues with custom fields. Please let us know if it's not working as expected for you.
Thank you!

Regards
Simpro API Team | Simpro Software Group
User avatar
cit
Posts: 24
Joined: Tue Apr 28, 2020 12:51 pm
Location: Milton Keynes, UK
Contact:

Re: API search on custom field and value

Post by cit » Wed Jan 22, 2025 4:55 pm

Hi API team,

We're having this same issue again but I'm not certain when it started, possibly within the last few days. Can you check if the previous fix is still on our instance please?

Thanks,
Duncan
Confidence IT Ltd
https://confidenceit.co.uk

IT SUPPORT | TELECOMS | HOSTING | CYBER SECURITY | AUTOMATION
Post Reply