Hey guys, I have developed a form in which user will add device name, type etc.... so if user knows the latitude and longitude of sensor, user can mention directly into the text field component if not they can type the location name once search button is clicked user can see the options in the dropdown to choose the location. i need to fetch the latitude and longitude of the location to the respective text fields.
You can see the output in the console i am getting the output of latitude and longitude i need to fetch those values into textfield i have tried my best to fetch it into textfield i am getting error stating typerror: list indices must be integers. Can you guys help me out kindly.
The property shown in the Property Editor is value, not values. Try, coordinates = self.props.value
That will return a dictionary, not a list, so you will need to refer to the elements using the key (and we can do it directly without introducing the coordinates variable): lat = self.props.value.lat lng = self.props.value.lng
Tips:
Use the Script Editor's Browse Properties button to pick properties. It can eliminate this type of error.