Iron Python get triggered in initial load for Spotfire Client but not for Spotfire Web player

1.1k views Asked by At

My script is to hide some pages for the some login User. My script get trigger well in Client not in Webplayer. To trigger this script i created the Data function property with Input and output parameter.

Input parameter as sysdate output assigned to document property where below script is present.

import Spotfire.Dxp
from Spotfire.Dxp.Data import * 
table=Document.Data.Tables["RestrictedSSO"]
minCol=table.Columns['GROUPNAME']
minCursor=DataValueCursor.Create(minCol)
for row in table.GetRows(minCursor): 
    Document.Properties["UserGroup"]= minCursor.CurrentValue;
    if Document.Properties["UserGroup"]=="Restricted":
        for Page in Document.Pages:
            if Page.Title == "ABCD":
                Document.Pages.Remove(Page)
            if Page.Title == "EFGH":
                Document.Pages.Remove(Page)

2

There are 2 answers

1
Tyger Guzman On

First check if there is a URL specified for the TERR Engine. A default setting might work in the client and not in the webplayer, so specifying the URL can ensure it works in both Client and Webplayer.

If that still does not help you can choose to initiate the python script via Javascript instead of the TERR sysdate output : https://community.tibco.com/wiki/how-trigger-python-script-report-load-javascript-tibco-spotfire

0
aavin On

When using TERR Check whether you have have checked refresh automatically and unchecked allow cache from script in data function.

Run terr on server rather than run locally.

Go to file-> Document properties -> uncheck Remember personalized view for each web client user.

Even after doing the above steps if it didn't worked , then you can also go with java script.