Page 1 of 2

Inventory search by other fields?

PostPosted: Tue Mar 22, 2022 8:25 am
by oliverbrooke
Hi there,
Is it possible to search the inventory by any fields other than PartNo?
For example, I want to search for matches within the Aux5 field.

For what it might be worth, I'm using PHP with cURL

Thanks :)

Re: Inventory search by other fields?

PostPosted: Tue Mar 22, 2022 9:20 am
by SBarnes
The short answer is yes, take a look at viewtopic.php?f=27&t=184

Basically you can have any SQL you like for inventory so long as the first field is the InventoryID in the select.

Re: Inventory search by other fields?

PostPosted: Tue Mar 22, 2022 9:24 am
by SBarnes
In rereading you post I am now not sure if you were talking about inside Jiwa or the REST api if its the latter then the route /Queries/IN_Main would allow you to do what you want.

Re: Inventory search by other fields?

PostPosted: Tue Mar 22, 2022 9:29 am
by oliverbrooke
Thanks for the quick response!
I'm using the REST API.
I'm currently having limited success with it but will persevere if you reckon it's achievable :)

Re: Inventory search by other fields?

PostPosted: Tue Mar 22, 2022 9:34 am
by SBarnes
Jiwa have a copy of the running api here https://api.jiwa.com.au/ that runs against a demo database, if you click on the link at the bottom for swagger ui and wait for it to load and then go to the queries section you will find the route I am talking about.

Re: Inventory search by other fields?

PostPosted: Tue Mar 22, 2022 9:34 am
by Scott.Pearce
Using our sample api:

1. Authenticate by going here:

https://api.jiwa.com.au/auth?UserName=a ... d=password


2. Use an autoquery, here (give it time to load):

https://api.jiwa.com.au/ss_admin/autoquery/IN_MainQuery

Play around with the column selection and filters. As you do so the URL to use is displayed at the top and is clickable.

Re: Inventory search by other fields?

PostPosted: Tue Mar 22, 2022 10:58 am
by Mike.Sheen
Another way is to go direct to the query without the UI (the UI will compose this URL for you when you choose fields and values to filter on) and searching on Aux5 and using an API key instead:

https://api.jiwa.com.au/Queries/IN_Main ... AsRJznB_Ok

Note the API key can also be passed via a bearer token request header instead.

Or even better - instead of IN_Main use the InventoryItemList view - and limit which fields are returned using the Fields= parameter:

https://api.jiwa.com.au/Queries/Invento ... AsRJznB_Ok

Re: Inventory search by other fields?

PostPosted: Tue Mar 22, 2022 4:59 pm
by SBarnes
Aux5 isn't in v_Jiwa_Inventory_Item_List?

Re: Inventory search by other fields?

PostPosted: Wed Mar 23, 2022 10:59 am
by Mike.Sheen
SBarnes wrote:Aux5 isn't in v_Jiwa_Inventory_Item_List?


Oh, lol. Don't use that if you want Aux5, then!

Making your own view which does use it and exposing the route is easy enough, however.

Re: Inventory search by other fields?

PostPosted: Wed Mar 23, 2022 11:02 am
by SBarnes
Interesting thing is the Auto Query doesn't error it just ignores anything it doesn't understand