Loading...

Search Using the API

Comments

36 comments

  • Chris Jolly

    Anybody still watching this thread?

  • Lee Tickett (Tickett Enterprises Limited)

    I am 👋

    Not sure if you mean Momentus staff specifically though :)

  • Chris Jolly

    Well maybe if we have a conversation somebody will know. I'm trying to search a field and need to figure out how to do a wildcard or similar. So currently searching with this format: {base_url}Bookings/{ORG_CODE}?search=StartDate ge DateTime'{formatted_current_date}' and Status eq '30' or Status eq '21' and (Space eq 'EXHA1' or Space eq 'EXHA2'or Space eq 'EXHA'or Space eq 'EXHB' or Space eq 'EXHC' or Space eq 'EXHD' or Space eq 'EXHA-B' or Space eq 'EXHA-C' or Space eq 'EXHA-D' or Space eq 'EXHB-C' or Space eq 'EXHB-D' or Space eq 'EXHC-D') since I could not figure out how to search for Space starting with "EXH". I tried Space eq 'EXH%' but this did not work. Any ideas how to return any Space the starts with "EXH" ???

  • Lee Tickett (Tickett Enterprises Limited)

    Can you try contains(Space, 'EXH') or substringof('EXH', Space) or indexof(Space, 'EXH') gt -1

    I'm not at my desk at the moment, but if you can't get it working, let me know and i'll figure it out- i'm sure i've done it before.

  • Chris Jolly

    (contains(Space, 'EXH') or substringof('EXH', Space) or indexof(Space, 'EXH') gt -1) Note that OData syntax is case sensitive. --Error: An unknown function with name 'contains' was found. This may also be a key lookup on a navigation property, which is not allowed.","Source":"ListData"}]}

  • Lee Tickett (Tickett Enterprises Limited)

    Did you try them "all together" or each on their own?

    I meant them as different options, not to be used together :)

    I just tested and this works for example:

    https://abc.ungerboeck.com/test/api/v1/Accounts/10?search=substringof(%27Tick%27%2C%20LastName)
     

Please sign in to leave a comment.