Popups that show specific data in a table depending on what button is pressed

So I have a map with markers on it and each one of these markers is a different tag. I want it so that when I click on one of these markers for my popup to show up, only the data that relates to the specific marker is shown. So my query has all of the data in it but I only want a popup of the data that relates to the specific tag.

Not sure this can be done but if it could it would make things a lot easier for me. Any help would be much appreciated

What query ?
How are its results stored ?

Make a view that takes the data you want to display as parameters, then use the onMarkerClick event to open a popup containing your view, passing it the appropriate parameters.

So i have a SQL database query linked to a table in ignition if thats what youre asking.

So i have the parameters page open but im not sure what its asking me for

Well, pretty much that. Just pass it the parameters name - value pairs that correspond to the data you want to display in the popup.
Though this may need some processing to extract the data of your markers - you might need a script instead of a simple popup action.

I think i will have to write some sort of script because i cant find anything under values. the only thing i can find that could be useful is content but i and then the path but that just sets the popup as the table with all the values instead of the refined one of the value related to the marker.

What sort of script could i write to target that specific data. For example I have a tag name called ‘firemain_hmi/status’ and want the marker to show the data in the table corresponding to that tag.

The event object provided in the onMarkerClick event provides the name of the marker. Maybe you can use that to reference the proper row in your table ( next(row for row in table if row['name'] == event.name) or something like that ).

So i have tried a few things and none of them seem to work. The popup is working when i click on any marker but its just showing all the values instead of just the value of the marker i clicked on

Show us what you tried. There’s nothing we can do without more information.

I made you a basic example:

First I have some data configured in the custom properties, this mocks the results of a query:

I add those as markers with a binding:

Now I have a map with my markers on it.

Next, I add the onMarkerClick event script:

Here’s the script:

def runAction(self, event):
	marker = next(m for m in self.custom.markers if m['name'] == event.name)
			'foo': marker['foo'],
			'bar': marker['bar'],
			'name': marker['name']

Nothing crazy, I just retrieve the marker in my original query result, based on the name of the marker.
Then I open a pop up and pass it the relevant information.

Here’s what it looks like:

1 Like

I was able to use what you gave me and it helped a ton. Took a while to understand it but I got it to work eventually.

Thanks a mil

1 Like