Changing colour of row based off value in cell in perspective table

If your incoming value was a dataset, the example above would be adjusted like this:

	pydset = system.dataset.toPyDataSet(value)
	returned_rows = []
	for row in pydset:
		row_dict = {}
		row_dict['country'] = row['country']
		row_dict['city'] = row['city']
		population = row['population']
		if int(population) < 3000000:
			population = {'value': population, 'style': {'backgroundColor': '#00FF00'}}
		row_dict['population'] = population
		returned_rows.append(row_dict)
	return returned_rows
2 Likes