Hi I'd like to filter this array
[
{
"Id": "JTJmZG9jdW1lbnRsaWJyYXJ5JTJmRXN0YWRvK2RlK0N1ZW50YSUyZjIwMjEwNyUyZjIwMjEwNy0xMjM0NTYucGRm",
"Name": "202107-123456.pdf",
"DisplayName": "202107-123456.pdf",
"Size": 11598,
},
{
"Id": "JTJmZG9jdW1lbnRsaWJyYXJ5JTJmRXN0YWRvK2RlK0N1ZW50YSUyZjIwMjEwNyUyZjIwMjEwNy0xMjM0NTcucGRm",
"Name": "202107-123457.pdf",
"DisplayName": "202107-123457.pdf",
"Size": 11598
},
{
"Id": "JTJmZG9jdW1lbnRsaWJyYXJ5JTJmRXN0YWRvK2RlK0N1ZW50YSUyZjIwMjEwNyUyZjIwMjEwNy0xMjM0NTgucGRm",
"Name": "202107-123458.pdf",
"DisplayName": "202107-123458.pdf",
"Size": 11598
}
]
basically I need to filter the object.Name = "202107-123456.pdf"
but I need to filter by making splits and just validate this 123456.
to be able to get this object like this:
{
"Id": "JTJmZG9jdW1lbnRsaWJyYXJ5JTJmRXN0YWRvK2RlK0N1ZW50YSUyZjIwMjEwNyUyZjIwMjEwNy0xMjM0NTYucGRm",
"Name": "202107-123456.pdf",
"DisplayName": "202107-123456.pdf",
"Size": 11598,
}
I did something like this but returns Empty array.
@equals(split(split(item()?['Name'], '.')[0], '-')[1], '123456')
thanks.
Solved! Go to Solution.
Instead of splitting it you can make use of the contains action, it helps to check whether a collection has a specific item. Return true when the item is found, or return false when not found. This function is case-sensitive.
I have tried doing a test from my side and it is working as expected and I was able to get the resulting value.
------------------------------------------------------------------------------------------------------------------------------
If the information shared helps, please consider giving a thumbs up 👍 and mark solution as resolved
Instead of splitting it you can make use of the contains action, it helps to check whether a collection has a specific item. Return true when the item is found, or return false when not found. This function is case-sensitive.
I have tried doing a test from my side and it is working as expected and I was able to get the resulting value.
------------------------------------------------------------------------------------------------------------------------------
If the information shared helps, please consider giving a thumbs up 👍 and mark solution as resolved
User | Count |
---|---|
27 | |
14 | |
12 | |
10 | |
9 |
User | Count |
---|---|
51 | |
29 | |
28 | |
24 | |
22 |