Maximo Open Forum

Expand all | Collapse all

How to use LIKE clause using OSLC WHERE

  • 1.  How to use LIKE clause using OSLC WHERE

    Maximo Certified
    Posted 01-18-2021 10:28
      |   view attached
    Hi,

    I am trying to understand how to use the LIKE clause using OSLC WHERE. 

    I read the following 

    For the LIKE clause, you can use the following variations:
    oslc.where=status="%APPR%"

    So I have tried to use this expression in the URL. Please see the attached. I am using POSTMAN to retrieve all the Storerooms which have the word T556 in the description. When I hit SEND, I receive the error. 

    Please let me know if I am missing something.

    #Integrations

    ------------------------------
    Regards,
    Kaushik Samaddar
    ------------------------------


  • 2.  RE: How to use LIKE clause using OSLC WHERE

    Maximo Certified
    Posted 01-19-2021 09:22
    syntax is okay, below are the all variations:

    oslc.where=personid=CAR%
    oslc.where=personid="CAR%"
    oslc.where=personid=%22CAR%25%22



    ASCII Encoding Reference
    https://www.w3schools.com/tags/ref_urlencode.ASP

    ------------------------------
    Abdul Qadeer
    MACC
    ------------------------------



  • 3.  RE: How to use LIKE clause using OSLC WHERE

    Maximo Certified
    Posted 01-21-2021 01:02
    Thank you Abdul. The encoding worked for me:

    This is the expression I used:

    https://<maximo-host>/maxrest/rest/os/MXSTORELOC/?description=%22%25T556%25%22. I suppose chrome did not support "% %", so they had to be encoded.

    ------------------------------
    KAUSHIK KUMAR SAMADDAR
    Compunnel Software Group Inc.
    ------------------------------



  • 4.  RE: How to use LIKE clause using OSLC WHERE

    Posted 01-19-2021 11:18
    I tried but got the same error, don't know what cause error. Alternatively, you could use other keywords combination as searchAttributes and oslc.searchTerms.



    ------------------------------
    Nhat Nguyen
    BienDong POC
    ------------------------------



  • 5.  RE: How to use LIKE clause using OSLC WHERE

    Maximo Certified
    Posted 01-21-2021 01:03
    Thank you Nhat. I have not tried these before. Let me try them.

    ------------------------------
    KAUSHIK KUMAR SAMADDAR
    Compunnel Software Group Inc.
    ------------------------------



  • 6.  RE: How to use LIKE clause using OSLC WHERE

    Posted 01-21-2021 01:21
    You're welcome. With these keywords you have the ability to do multi-field searching. For example, if you might have Part No. or Model No. in both Item Description and Inventory Modelnum. You could perform same filter to both fields, just add additional fields to searchAttributes. The API will filter either description or modelnum with same specified searchTerms.

    ------------------------------
    Nhat Nguyen
    BienDong POC
    ------------------------------