Advanced configuration of KPI cards in Geocortex Web

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone my name is patrick fingler and in this tech tip video we're going to take a look at some advanced kpi card configuration and how you can leverage workflows to update kpi cards dynamically to create some dashboard like apps for your geocortex web applications let's dive in all right we're going to kick things off here actually inside of a customer application so this is the city of portland's permit metric map app application that they've built with geocortex web and immediately you'll see here that they've added some kpi cards at the top now what's really interesting is as the user zooms in and out or pans the map you'll notice that these kpi cards are being updated on the fly now what's happening in the back background is essentially they've configured a workflow that fires every time the user pans the map or zooms in and out essentially every time the extent of the map changes and what that does is it queries all of these different layers so there's a couple different layers inside of the app and it will essentially query you know how and identify how many features for that layer are within the given extent and then update the kpi cards accordingly now in this application here these are different permits and they've been symbolized accordingly but in you know another application you could have different assets and so on that you might want to display counts and so on so how does you know someone actually build this so let's navigate to geocortex web and here you can see i've added some kpi cards and i've purposely um made that this made this building's kpi card not you know fully functioning so we can kind of walk through how to put it together but here you can see that if we zoom in and out we're going to be updating these um kpi cards for the fire hydrants in the water line so it's essentially querying all of the assets within the given extent and giving us a count and again if we zoom really far out it's going to give us a you know a total count for all the fire hydrants and water lines within the given extent so to essentially build this um what you'll first need to do is navigate to the map tab here and we'll scroll down and there's an events section so here we can scroll down and you'll see here there's this map viewpoint changed event and here what i've done is i've configured a workflow to fire every time the maps viewpoint changes so again what you'd want to do is you just click edit you'd click workflows and then you could click you know create a new workflow to start from scratch and here i've selected you know an existing workflow so let's walk through this process so if we go into the workflow itself there's kind of three main sections here the first section is just to set up your workflow and define what layers that you want to generate some kpi cards on the third the second step is to query those layers and then the third step is just to update uh and run some commands to to update those kpi cards uh so in the setup container it's again not not too long of a a workflow um what we're doing is we're using the get workflow inputs command this is going to give us the current map extent and here i'm just assigning this to a variable so i'm doing get workflow inputs dot inputs we're getting the context we're going into the maps object and then we're getting the extent now this is one way to do it you could also just use the get map extend activity and that would also work just fine the next thing that we're doing is we're creating this uh features array variable which is going to hold the results of our queries that we perform so this is a key step here we've we've just created an empty object which is an empty array and then here we're just essentially getting the layers that we want to include in our kpi card so i'm using the get layer activity and i'm getting the fire hydrants layer i'm getting the water lines layer and i'm also getting the buildings layer once you have those layers we can then query them so here let's open up our query layers container and here you can see i'm using the query layer activity i'm supplying my fire hydrants layer here we're essentially wanting to identify all the fire hydrants within the current map extent we're just doing a one equals one we don't want the geometry because you do want this to be a very performant query because it's running every time the user pans the map and then one way to make that very performant is to use what are called out statistics and this is a capability within arcgis server so here we can say we want to do a count so this is the statistic type property you can find documentation on this in esri's arcgis server documentation but essentially what we're doing is we're doing a count we're doing a count on the object id which is our statistic field and then you can specify an out statistic field name we're just going to set this to be also object id um you could assign this to another attribute but it's worth mentioning that you'd probably want it to be um a like an integer or a double um so here we're essentially doing a count and we're getting um we're essentially outputting a single attribute called object id which is going to have the count of the features within the current extent and this same process we're doing for all the other queries as well so again for the water lines we're passing the water lines layer we're querying it based on the map extent and then we're also using that same out statistics object on our object id uh in between these you can see here we're just adding the results of these to our features collection or features array um so here we're i'm adding an item to our features collection and this is just going to be the output feature from our query which will just be a single feature that has that object id attribute which is actually going to be the the count of the features so we're doing that for all three layers and then if we go to the update kpi container let's double click that and then this next step is important so we're going to convert that features array which contains esri features into what's called a vertices feature we do have other tech tip videos that i'd recommend watching if this is new to you so definitely check those out but essentially what this process does is it uses this operation results.from graphics to convert these esri features which is our features array object which are called graphics and that will output a vertices feature which we can then use for other native geocortex web commands and operations here we're going to run a command called kpi.display and this is where we're going to supply the vertiges features again check out our tech tips there's lots of documentation on our developer center to learn more on how to use those now let's just again save that that's essentially the workflow let us know we can always upload this to the community or something like that if you want to get access to it but that's the general workflow now in regards to the kpi card configuration let's go to our buildings kpi card because it's not working properly so here we can here i've added a kpi card and i've connected it to our buildings layer uh this is uh you know i've adjusted the coloring of it so it is you know purple and i've just added a little you know some text here to say buildings and then if we look in the middle section here this is where it's this value property is essentially going to be the value of the count or attribute that we want to include in the kpi card but really the key step here is we're going to um click sum and you'll notice here the object id field isn't being listed in here so let's and that's the output field that we've configured in the out statistics so let's go to advanced mode and then just update this to say object id so we're now doing a sum and we're getting the object id and so now here if we go zoom in and out we now have some kpi cards that are nicely configured that are you know very fast it's not really taxing our arcgis server too hard and they're including some counts based on the features uh within the given extent so i hope you found that valuable um and yeah be sure to reach out if you have any questions bye for now
Info
Channel: Geocortex
Views: 61
Rating: 5 out of 5
Keywords:
Id: yaP2VHyH_S8
Channel Id: undefined
Length: 9min 42sec (582 seconds)
Published: Fri Sep 03 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.