Michael Zaragoza Posted August 17, 2019 Share Posted August 17, 2019 Newbie question here. I'm unable to get a comparison operation to work using a multilist document property in an Iron Python script. The document property has one of two values, "PASS_NUMBER" or "FAIL_NUMBER", which the user can select and with a change in property value the script runs. The comparison I'm testing is the following: if Document.Properties["TestSumResult"] == "PASS_NUMBER": With Document.Properties["TestSumResult"] set to "PASS_NUMBER" the expression effectively returns false eventhough that's not the case. What am I doing wrong Here's whole script: from Spotfire.Dxp.Data import DataColumn, TagsColumn from Spotfire.Dxp.Data import DataPropertyClass, DataType, DataValueCursor, IDataColumn, IndexSet from Spotfire.Dxp.Data import RowSelection # Tag the marked rows markedRowSelection = Document.ActiveMarkingSelectionReference.GetSelection(Document.Data.Tables["MyData"]) table = Document.Data.Tables["MyData"] myTagColumn = table.Columns.Item["TestSum"].As[TagsColumn]() if Document.Properties["TestSumResult"] == "PASS_NUMBER": selectRows = IndexSet(table.RowCount, True) myTagColumn.Tag("Good", markedRowSelection ) else: selectRows = IndexSet(table.RowCount, True) myTagColumn.Tag("NotGood", markedRowSelection ) Link to comment Share on other sites More sharing options...
Shandilya Peddi Posted August 19, 2019 Share Posted August 19, 2019 MultiList document propert is a List, so you can try to use the following code instead if Document.Properties["TestSumResult"][0] == "PASS_NUMBER":As there are only two values in the list box and based on your code the user is allowed to select only one value, in this case wouldn't be better to use just a list box instead of multiselect Link to comment Share on other sites More sharing options...
Michael Zaragoza Posted August 21, 2019 Author Share Posted August 21, 2019 Thanks, Shandilya, adding in "[0]" worked! Also changing the document property to a List Box and without the "[0]" also worked. But how could you tell that the document property was a multiselect Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now