So, you’re able to configure straight-line diagrams and alignment sheets quickly within a graphical interface.
But, now, you’re wondering how to add user added data to Geocortex Inline. What do you do?
The most common way to add data to Geocortex Inline is either as a feature service or a map service layer. This requires your data to be published by ArcGIS Server or through ArcGIS Portal.
A new feature in Geocortex Inline allows you to add data using Geocortex Workflow, which means that you can add data from pretty much any source.
So, if your data is a SQL server or if your data is an Excel or CSV file, you can add it by using Geocortex Workflow, which will pull the data and then present it as a chart in a band in Geocortex Inline.
Watch how this is done in this week’s Geocortex Tech Tip video below.
Video Transcript
“Hello! I’m Colin Doak. I am a Technical Advisor with the Partners team here at VertiGIS and I’m going to show you how to add user added data to Geocortex Inline. Let’s get started!
The most common way to add data to Geocortex Inline is either as a feature service, or a map service layer. This requires your data to be published by ArcGIS Server or through ArcGIS Portal.
A new feature in Geocortex Inline allows you to add data using Workflow. What this allows you to do is add data from pretty much any source. So if your data is in a sequel server or if your data is an Excel spreadsheet or a CSV file, you can add it by authoring a workflow that pulls the data in and then presents it as a chart within a band in an inline view.
Let’s have a look at that in action. You can see right here; I’ve got some Waze traffic alert data that I’ve published in a chart band in Inline. What I’d like to do is that I’d like to add some additional Waze data that I have local on my machine, stored as a CSV file.
What I’ve done, is that I’ve authored a workflow that allows me to do that.
I publish the workflow as an action for this particular band and the action is called Add CSV Data to Band. What that does is it fires up a workflow which allows me to select a file on my local machine. Once I click Next, what that will do is add an additional band below the original band.
So, here we have original Waze alerts bands, the red one and below that the blue one is a new Waze alerts. You can see that it’s not the same data. This is the data that’s been added from the CSV file.
So, how do we do that? Well, it’s a couple of things. One, of course, you have to author a workflow to do it and then you have to configure the Inline view to use that workflow as an action.
Let’s first look at the Inline configuration. So over here, we can have a look at our actions. You can see that I have that Add CSV Data to Band action right here and you can crack that up.
What I’m doing is I’m using a command called ‘GetDataFromWorkflowinNewBand’ and the inputs have for this command – the only thing that’s really required is the URL, but what I’ve done is I’ve actually included a bunch of parameters because I like to parameterize my workflows. And in this case, actually the workflow that I’m using or the workflows that I’m using are fairly generic. And the reason I did that is I wanted to be able to use the same basic structure for this workflow to be applied to other data sources like Excel XS or perhaps any other flat file. So, by making it generic and parameterizing it, I was able to do that.
There’s a lot of parameters here that perhaps if you were to author your own, you don’t have to really worry about.
We’ve got the URL, which is, of course, is a source, the URL workflow URL. I’ve got another one here called – poorly named – ‘workflowURL’ that’s responsible for presenting the CSV form that you saw. Then I’ve got a ‘datatransferformURL’, which actually transforms this CSV file to a feature set. Some parameters here, the Y-axis field that’s going to be in CSV data that allows me to plot it on the Y axis. I’ve got some other sort of form data here or the CSV. So, this way ‘formTitle’, subtitle description and ‘fileTypes’. If I do this then what I can do is I can have the form generic and of course the delimiter. If a CSV, is we’re doing a comma, but this could be a pipe or tab or whatever.
So, these are my parameters for my workflow. Once I’ve set up the actual action, what I can do is I can go ahead and add it to the band.
Go down here, you can see the band actions, one of them is dated CSV data band. So that’s as simple as that!
Now, a few caveats. You have to be aware of – this Waze data source here. This is coming from the band name, and this chart is coming, the data is wazejam. It’s important and it’s required actually, that in the data source, the measure field and the field that you’re pulling in from your external data, they have to match, otherwise it won’t know how to plot it. So, if you have in a CSV file, you have to make sure that the field that you’re plotting is actually measure. And you can see mine is a measure.
Of course, you could also do this so there could be a different field. And in your actual workflow, you convert the field name from whatever it is. So, this could be, for example, station. And then in your workflow, you could actually programmatically change that to measure so that they match. The take-away is that the fields need to be the same, the field names need to be the same. So that’s the one thing you need to be aware of.
Now, I’m not going to go really deep into the workflow itself, but I’ll just say there’s a few things that you should be aware of. One is, well, first, this is my Inline data source. So, I created in a generic Inline data source workflow. So, this can be a CSV file, an Excel file or whatever. And what it does is it’s got those steps. So, we initialize all of the data. We won’t get into that. But there’s a Get Data Workflow and all this does is it just runs a workflow. That’s that workflow URL that I showed you earlier. And this is what’s responsible for generating the feature set. So, one of the things that one of the outputs is this is an actual set of features. This is basically an array of features and then we create a feature set from it.
So, you can see right here that I’m creating the output of that workflow result features, I’m adding it and creating a feature set. The important thing is for the output for this Inline data source, in order for it Inline to understand how to use it, it has to have an output variable called featureSet cases. It’s case sensitive. And of course, this needs to be a feature set.
So whatever else you do here, how you get the data, how you transform it, any set of operations you do to it is entirely up to you. But the one thing in order for the workflow to be consumed by Inline is those two things. One, the measure values or measure fields need to match and the output variable needs to be feature set and needs to be a feature set.
So, if you can do those two things, you can add data to your Inline as a band and a new band or an existing chart.
That’s how you do it!
I’ll go a little bit into the other parts. So, to Get Data workflow, what that does is it calls this workflow, let me jump into this guy, and what this this does is it goes through and it presents a form. Right here.
So, we can add a file. And what that does is it converts it to that file to Base64 String and calls another workflow, and this is a server-side workflow, because we are having to do some data conversion. It’s very difficult to do that in a web browser, JavaScript. It’s much easier when you’re online. So, I created a server-side workflow. In this case, it’s the CSV feature set. It’s a very simple you get your workflow inputs, which is your Base64 String, then you convert it to Base64 string to bites and then bites the text, and then you convert it to a data table, and then you give her data table to a feature set, and then that’s it, you’re done!
So now you have your features. You can bring that back to your form here. Once you’ve got the data, you’re just basically pushing that back to your Inline data source right here, and then what you do is you want to filter your results, make sure that it fits within the range, and then you’re all done.
Just remembering that was the final output is a feature set and the name of the variable is case sensitive, lowercase F feature, uppercase S set.
Using this technique, you can basically build out any workflow to pull in any kind of data source from pretty much any source you want. So, I’ve done a few, I’ve done Excel, I’ve done CSV. I’ve also I’ve done for JSON web services. I’ve done one where we’ve pulled data in from SQL Server rather than using a feature service. So, you know, the sky’s the limit. You have a lot of flexibility in how you pull data in!”
Liked learning about configuring charts in Geocortex Inline and want to learn more about how it can solve your linear referencing needs? Click the button below for more product information, or to book a demo.