How to splice an xpath containing variables

hi, I have such a scenario, for example, I want to find a row corresponding to the text value xx, xx comes from the excel sheet in the data drive, how do I achieve the click of // span[text()=‘xx’]

Are you thinking of the below technique:

thanks,I also read this article this morning, it took a long time to understand