Referencing a custom property using variable

I want to run the same python code for several custom properties in a vision window on a triggered action. All of the custom properties are a dataset, so I want to pull that data into a variable called "rawData" and then run the code against that data.

In order to avoid copying & pasting repetitive code, I wanted to try building the custom property names as a string and then running the code in a loop. The issue I am running into is I can't figure out how to reference a custom property according to a string name. I pasted the segment of code below. Any help would be appreciated, thanks!

For reference there are 22 custom properties: base2 - base8, cush1 - cush8, pill1 - pill7

	for i in range(3):
		if i == 0:
			component = "base"
			numStations = 7
		elif i == 1:
			component = "cush"
			numStations = 8
		else:
			component = "pill"
			numStations = 7
		
		for j in range(numStations):
			if i != 0:
				station = str(component + str(j+1))
			else:
				station = str(component + str(j+2))
			stationData = "event.source.parent." + station
			rawData = stationData
                            #and then this is where the code would go that references the raw data

Use getattr to dynamically reference an attribute.

Perfect! Thanks so much