Dec 26, 2018 · and I wanted to get a list which contains one or both subnet ids depending on bool variable. Possible steps were: Turn a map into a list. If we need both subnets: Get the first list value (string, "subnet-1,subnet-2"). If we need only one subnet: Get the first list value (string, "subnet-1,subnet-2").. "/>