Note sure if I'm understanding your requirement properly, but you could dome something similar to this:
- You have some variable or parameter that contains your the specific value you're searching for
- You use a retrieve from DB to query your SelectData and and XPath statement to filter an attribute of that entity that should contain your specific value
- This will already create you a list of objects that contain this specific value. So you can check if that list has results: $SelectDataList_WithSpecificValue != empty
- If there are no results, create that SelectData object and set the specific value you were searching for