question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Filter with startswith/endswith

See original GitHub issue

Hello, using the SAP Cloud SDK (v. 1.38.0) to apply the filter function startswith (or endswith) the code may look like this:

import { filterFunctions } from '@sap-cloud-sdk/core';

const destination = getDestinationFromSomewhere();
SomeEntity.requestBuilder()
.getAll()
.filter(filterFunctions.startswith(SomeEntity.SOME_PROPERTY, 'm').equals(true))
.execute(destination);

This is the resulting URL (shortended for simplicity): https://<host>:<port>sap/opu/odata/sap/<service-name>/SomeEntity?$filter=(endswith(SomeProperty, 'm') eq true)

Some properties may require the filter to be used as follows (without “eq true”): https://<host>:<port>sap/opu/odata/sap/<service-name>/SomeEntity?$filter=endswith(SomeProperty, 'm')

Is it possible to build this URL using the SAP Cloud SDK?

Thank you in advance.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:20 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
ja-necommented, Apr 22, 2021

Hi @jjtang1985.

thanks for the fix. I’ve tested and it works as expected.

0reactions
jjtang1985commented, May 4, 2021

Hi all, we released 1.42.0, so you can switch to the new version for this fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

EndsWith and StartsWith functions in Power Apps
Use EndsWith and StartsWith with the Filter function to search the data within your app. You can also use the in operator or...
Read more >
Spark Filter startsWith(), endsWith() Examples
Spark filter startsWith() and endsWith() are used to search DataFrame rows by checking column value starts with and ends with a string, ...
Read more >
Filter array with multiple startsWith and endsWith arguments
You can use Array.prototype.some on the pattern arrays to achieve this: let filtered = names.filter(name => ( startPatterns.some(pattern ...
Read more >
Filter by Names using StartsWith and EndsWith | Targetprocess
You can filter out cards with the names that starts or ends with certain characters or letters with the help of StartsWith and...
Read more >
Using EndsWith, StartsWith & Contains to Filter DataFrame ...
Using EndsWith, StartsWith & Contains to Filter DataFrame Columns. Python. Data Preprocessing. 1| #Only keep rows where the text_column string ends with ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found