MxLoader

 View Only
  • 1.  API and NOT LIKE (!=)

    Posted 11-03-2021 09:56
    Hi,

    I have MxLoader 8.2 and use Rest, in one of my Query I want to search ASSET for everything but "skrot" so I write like this:
    description!="%skrot%"

    But this doesn't work, the answer is just everything with "skrot"

    If I write:
    description="%skrot%"

    I get only things that contain "skrot" so my question is if "!=" ( Not Like ) is working with text too or only numbers?

    Have anyone got the same problem and what is the solution?

    Thanks.

    ------------------------------
    Manuel Guyot
    Husqvarna AB
    ------------------------------


  • 2.  RE: API and NOT LIKE (!=)

    Posted 11-04-2021 09:45
    Hey Manuel

    Have you tried your query like this: description not like '%skrot%'

    Wildcard don't always work well with != (not equal).

    Hope this helps

    Troy

    ------------------------------
    Troy Brannon
    Alcon
    ------------------------------



  • 3.  RE: API and NOT LIKE (!=)

    Posted 11-05-2021 08:44
    Edited by Manuel Guyot 11-05-2021 10:09
    Hi Troy, thanks for your answer, if I have understood well, when Querying with API Rest so we have to use = or != instead of Like or Not Like ( https://bportaluri.com/2021/04/mxloader-rest-query-where.html ) but perhaps I have misunderstood it, at least the = is working well!

    ------------------------------
    Manuel Guyot
    Husqvarna AB
    ------------------------------



  • 4.  RE: API and NOT LIKE (!=)

    Posted 11-05-2021 10:38
    Hi Manuel, do you have logging enabled for MxLoader? I setup a test and tried to mimic what you were doing. It is working. I am using MxLoader 8.2 and Rest.

    2021-11-05 09:33:15 [INFO] ------------------------------------------------------------
    2021-11-05 09:33:15 [INFO] Sheet name : Assets
    2021-11-05 09:33:15 [INFO] Object service : MXASSET
    2021-11-05 09:33:15 [INFO] Object name : ASSET
    2021-11-05 09:33:15 [INFO] Action : Query
    2021-11-05 09:33:15 [INFO] Where : description!="%rack%"
    2021-11-05 09:33:15 [DEBUG] Order By :
    2021-11-05 09:33:15 [DEBUG] OSLC Directives :
    2021-11-05 09:33:15 [DEBUG] Attr(1) : ASSETNUM ()
    2021-11-05 09:33:15 [DEBUG] Attr(2) : SITEID ()
    2021-11-05 09:33:15 [DEBUG] Attr(3) : DESCRIPTION ()
    2021-11-05 09:33:15 [DEBUG] Attr(4) : STATUS ()
    2021-11-05 09:33:15 [DEBUG] Attr(5) : LOCATION ()
    2021-11-05 09:33:15 [DEBUG] Attr(6) : PARENT ()
    2021-11-05 09:33:15 [INFO] ------------------------------------------------------------
    2021-11-05 09:33:15 [DEBUG] HTTP call GET: /maximo/api/os/MXASSET?lean=1&oslc.select=assetnum,siteid,description,status,location,parent&oslc.pageSize=51&oslc.where=description%21%3D%22%25rack%25%22

    ------------------------------
    Adam Ames
    Kwik Trip, Inc.
    ------------------------------



  • 5.  RE: API and NOT LIKE (!=)

    Posted 11-05-2021 10:52
    Hi Adam,

    Yes, here is my logging:

    2021-11-05 15:45:14 [INFO] ------------------------------------------------------------
    2021-11-05 15:45:14 [INFO] Sheet name : Assets
    2021-11-05 15:45:14 [INFO] Object service : MXASSET
    2021-11-05 15:45:14 [INFO] Object name : ASSET
    2021-11-05 15:45:14 [INFO] Action : Query
    2021-11-05 15:45:14 [INFO] Where : assetnum="A%" and location="1886682" and status="OPERATING" and description!="%skrot%"
    2021-11-05 15:45:14 [DEBUG] Order By :
    2021-11-05 15:45:14 [DEBUG] OSLC Directives :
    2021-11-05 15:45:14 [DEBUG] Attr(1) : ASSETNUM ()
    2021-11-05 15:45:14 [DEBUG] Attr(2) : SITEID ()
    2021-11-05 15:45:14 [DEBUG] Attr(3) : DESCRIPTION ()
    2021-11-05 15:45:14 [DEBUG] Attr(4) : STATUS ()
    2021-11-05 15:45:14 [DEBUG] Attr(5) : LOCATION ()
    2021-11-05 15:45:15 [DEBUG] Attr(6) : PARENT ()
    2021-11-05 15:45:15 [INFO] ------------------------------------------------------------
    2021-11-05 15:45:15 [DEBUG] HTTP call GET: /maximo/api/os/MXASSET?lean=1&oslc.select=assetnum,siteid,description,status,location,parent&oslc.where=assetnum%3D%22A%25%22%20and%20location%3D%221886682%22%20and%20status%3D%22OPERATING%22%20and%20description%21%3D%22%25skrot%25%22

    But in the answer I got:
    {
    "DESCRIPTION": "skrotad",
    "ASSETNUM": "A55101",
    "SITEID": "HM",
    "LOCATION": "1886682",
    "STATUS": "OPERATING"
    },
    or
    {
    "DESCRIPTION": "skrotad",
    "ASSETNUM": "A55100",
    "SITEID": "HM",
    "LOCATION": "1886682",
    "STATUS": "OPERATING"
    },
    which contains "%skrot%" so something is strange if it is working for you...

    ------------------------------
    Manuel Guyot
    Husqvarna AB
    ------------------------------



  • 6.  RE: API and NOT LIKE (!=)

    Posted 11-17-2021 09:07
    Hi,

    I tried again without the % => description!="skrotad" and it works but I can't use the % on the side, can anyone confirm that?

    ------------------------------
    Manuel Guyot
    Husqvarna AB
    ------------------------------