ACL: Add a Custom View to a Table

Adding a custom view to an ACL table comes in handy when you want to 1) change the order of the fields in an ACL table, or 2) view a select number of fields.

You can add a custom view manually or via script. We’ll tackle the script version first.

This post is in response to Les’ question about reordering fields in a table.

Add Custom View via Script

Let’s assume we have a table called servers1 containing 3 fields in the order shown. Note that the table is shown in the Default_View (see yellow highlight), which is the default view of every table.

ACL default tabel view

You want to reorder the fields so that Install_Date is the first field shown in the table. Here’s the script to that creates a view called Custom_View, which I wrote as a standalone script.

ACL create custom view script

Please note that this does NOT change the order of the fields in the actual table; it just changes the order of the fields in a view.

When you run this script, your table will look like this, based on your new Custom_View (note that the Install_Date field is listed first):

custom view

To add this code to an existing script, you would just copy lines 6-9 to your script, and change the field names and the view name.

If the existing script hasn’t opened the table yet, you’ll need to include line 5.

A few notes about the script:

  • Line 3 prevents you from getting prompts when the table is updated with the custom view
  • Line 5 opens the table to which you want the custom view added.
  • Line 6 defines the name of the new view (Custom_View). View names cannot contain spaces.
  • Lines 7-9 add the columns (fields) to the custom view
  • The OK at the end of line 6 prevents you from getting prompts when you add the custom view.
  • If this is the last part of your script, the custom view will be the one that is displayed. To see the Default_View, just click the Default_View tab.

When I create computed fields, I like to create a custom view called  “Computed_Fields” so that I can quickly review the field values to verify that they are accurate. That way I don’t have to scroll through the table to see the computed field values.

Add Custom View Manually

Sometimes it helps to understand what a script is doing by understanding how to do it manually. Here’s how to do the same thing step-by-step.

1. Right click on the Default_View tab at the bottom of the screen (see yellow highlights) and select New.

ACL create custom view

2. Enter a name for your view and click OK. View names cannot contain spaces.

ACL naming a custom view

3.  Select the first field you want displayed in your table, and click the right arrow to add the field to the Selected Fields box.

ACL add fields to custom tabel view

4. Add the remaining fields one-by-one, and click OK. Your table will look like this:

custom view

Pretty cool, huh? Let me know what you think.

Other ACL posts:

ACL tip: What is a Computed Field?

ACL: How to Add a Computed Field

Teach Yourself ACL (most popular post on this blog)

Index of all ACL Posts


1 Comment

Filed under ACL, Data Analytics, How to..., Scripting (ACL), Written by Skyyler

One response to “ACL: Add a Custom View to a Table

  1. Pingback: ACL: How to Add Computed Fields via Script | ITauditSecurity

Leave a Comment

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s