I think we are starting to get a good collection of Blogs and How To papers for the Visual Composer that show how to do some pretty cool stuff. But, the Visual Composer is still relatively new technology, and I am still getting a lot of “simple” modeling questions via email. Simple is of course a relative term – it just depends on how long you have been working with the Visual Composer for 🙂
So I thought I might address a few of the more common ones that I came across, in a few blogs.
I’ve chosen a couple to start with here….
Column Widths in Table Views
You have dragged a BI Query into the VC storyboard, and you have connected a Table View to the output port. You have then gone into the Layout tab, and changed the widths of your columns. You deploy your model, and run it. As soon as the data comes back, all of your columns go back to equal width.
What happened? How to make those columns stay the same width that you specified at design time?
The good news is that it is surprisingly simple. All you have to do is double click on the output port of your BI query (to bring up the Configure properties), and deselect the checkbox called “Dynamic Port” (see the below image).
And that’s it… Seriously…
The dynamic port flag, if switched on, means that the Table View can have a dynamic number of columns. If you have a fixed number of columns being returned, then you dont need to have the port flagged as dynamic, so you should be fine to switch it off.
Ok, one more for today…
Passing Values from a Data Series in a Chart
The scenario here is that a user should be able to click on a data series in a chart, and have the value they click on be passed on to another data service. This can be used for example, to return some detailed information about the selected value.
So you model a basic application, like the one below. In my example, the Chart View will displayed Planned vs. Actual Responses for my open Campaigns in CRM. I want to be able to click on a campaign in this chart, and then see a breakdown of planned vs. actual responses over time. In order to do this, I simply drag out from the “out” port of my chart, and connect it to the “Input” port of my BI query that returns the campaign information by time, as shown in the below image.
But, when you deploy this model, you will see that no information is getting passed to my second BI query. What’s going wrong?
What we are missing, is the event that needs to occur when values need to be passed from the chart to my second query. In this case, the event is the “select” event (ie. whenever a user selects a campaign in the chart, then I want the system to pass that campaign to my BI query).
So, all we have to do to get this working as expected, is double click the line connecting the “out” port of the chart with the “input” port of the BI query (to bring up the Configure properties of this line). Then, simply type in the field “Event name”, the value “select” (this is highlighted in the below image). Note: this event is not available from the drop down list of events – you will need to type it in manually.
Technically, thats all you have to do. But an important point to note is that if you are using BI Queries, as in this example, then you will want to address the field mappings too. By default, the system will propose to pass the “value” of a characteristic, however, when passing values to the input or variables port of BI queries, you need to supply either the “key” or “external key” (for more information about this, please see this How To guide).
So in my case, I will change the mapping to pass the key value (this change has also been highlighted in the below image).
So I hope these type of modeling basics is useful for some of you out there!