I have an array as:
[
{
"Name": "Ca_somethingunkown"
},
{
"Name": "Mv_somethingunkown"
}
]
Am trying to get output in Power Automate as only "Mv_somethingunkown", while just searching as Mv as the array will be dynamic and after Mv the text will be changed everytime.
I tried Filter Array, Compose, Select, Startswith, Contains. But Either am getting again array as result or no output.
Expression I used in Filter Array is: @startwith(['Name'],'Mv')
Post updating expression per Skin's Answer the Output is per below:
{
"body": [
{
"Name":"Mv_somethingunkown"
}
]
}
I was trying to get the desired output as only "Mv_somethingunkown" as a string and no more arrays.
I can only suggest that you're not applying the expression(s) correctly ...
This is the Filter Array
step ...
... the expression on the left is ...
item()['Name']
... so the entire expression in advanced terms is ...
startsWith(item()['Name'],'Mv')
Then to extract just the value, use an expression like this in a Compose
operation ...
first(body('Filter Array'))['Name']
... or ...
body('Filter Array')[0]['Name']