[{id:1, name:"test1"},
{id:2, name:"test2"},
{id:3, name:"test3"},...]
- get id based on the name
- get id's based on the list of names
You can use JSON JMESPath Extractor which allows executing JMESPath queries for getting the values from JSON data, if you want to filter results - you can go for Filter Expressions, example query:
[? name=='test1'].id
Demo:
More information: The JMeter JSON JMESPath Extractor and Assertion: A Guide