Filter with startswith/endswith
See original GitHub issueHello, 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:
- Created 3 years ago
- Reactions:1
- Comments:20 (13 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @jjtang1985.
thanks for the fix. I’ve tested and it works as expected.
Hi all, we released 1.42.0, so you can switch to the new version for this fix.