Tracing Data Transformations from IronPython

Have you ever needed to gather details about transformations used in all Data Tables ? I know, you will go to Data Panel 👴
Now a twist - What If you have 20+ Data Tables ? Now you are getting irritated !
That's why we have IronPython ✌.
Although it is programmed to look for very basic details, but can be customized for more stuffs 💪

from Spotfire.Dxp.Data import *
from Spotfire.Dxp.Data.Transformations import *
from Spotfire.Dxp.Data.DataOperations import *
from System.Collections.Generic import List

for table in Document.Data.Tables:
    sourceview=table.GenerateSourceView()
    for op in sourceview.GetAllOperations[DataTransformationsOperation]():
        for t in op.GetTransformations():
            print t.Name
            #print t.GetType() #Un-comment & Google for this row's output for Documentation when you need
            if t.Name=='Filter rows':
                print "\tExpression : ",t.Expression
            if t.Name=='Replace value':
                print "\tColumn :",t.Column
                print "\tOriginal Value : ",t.OriginalValue
                print "\tNew Value : ",t.NewValue
Share: