CA Service Management

 View Only
  • 1.  How to find records with a search clause using REST?

    Posted Mar 20, 2017 03:51 PM

    Hi guys,

     

    Does anyone here know how to make a query using REST in the SDM tool so that a record search clause is specified?

    I have already consulted the official documentation available here but I can not use the "&" concatenation.

    Example below:

    Object nr
    Name = 'HERRERA'
    Delete_flag = 0
    Descrition LIKE 'test'

     

    If you can help, thank you.



  • 2.  Re: How to find records with a search clause using REST?
    Best Answer

    Posted Mar 20, 2017 04:16 PM

    Hi Danial,

    The Where Clause will use the AND operator to concatenate the attribute values passed as seen below:

     

    http://<hostname>:<rest-port>/caisd-rest/nr?WC=name%20LIKE%20%27%25test%25%27%20AND%20delete_flag%3D0

     

    Which translates to:
    http://<hostname>:<rest-port>/caisd-rest/nr?WC=name LIKE '%test%' AND delete_flag=0

     

    Where the HTTP URL encoding is as follows:

     

    = : %3D

    space : %20

    ' : %27

    % : %25

     

    The percent symbol is necessary when using the LIKE operator to pass as a wildcard.

     

    Below are the three attributes you listed passed into the Where Clause:


    http://<hostname>:<rest-port>/caisd-rest/nr?WC=name%3D%27HERRERA%27%20AND%20delete_flag%3D0%20AND%20description%20LIKE%20%27test%25%27

     

    Which translates to:

    http://<hostname>:<rest-port>/caisd-rest/nr?WC=name='HERRERA' AND delete_flag=0 AND description LIKE '%test%'

     

    Please let me know if this answers your question.

     

    Regards,

    Kurt



  • 3.  Re: How to find records with a search clause using REST?

    Posted Mar 21, 2017 01:17 PM

    Thanks so much! Works fine!