Manoj Chaurasia Posted January 3, 2014 Share Posted January 3, 2014 I want to be able to create an input property that a user can use to limit the values in a property control. For example, I want a multi-select list box property with customer names. I want the user to be able to enter a value in an input property and click search...and have it limit the available names. I've seen an example of this for column names, but not values within a column. Any help on writing the script would be appreciated. Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted October 23, 2015 Author Share Posted October 23, 2015 This is as far as I've gotten: from Spotfire.Dxp.Data import DataPropertyClass import re patternString = re.compile (pattern) from Spotfire.Dxp.Data import IndexSet from Spotfire.Dxp.Data import RowSelection from Spotfire.Dxp.Data import DataValueCursor from Spotfire.Dxp.Data import DataSelection rowCount = Document.ActiveDataTableReference.RowCount rowsToInclude = IndexSet(rowCount,True) cursor1 = DataValueCursor.CreateFormatted(Document.ActiveDataTableReference.Columns["DealerName"]) rowstoFilter=Indexset (rowCount, False) Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted October 23, 2015 Author Share Posted October 23, 2015 I have done this before through adding calculated fields instead of scripting. This is particularly useful when you want the user to be able to change the filter criteria. (1) create a drop down selection box with the column names that you want the user to be able to filter the customer name selection (e.g. Dealer, State, etc..) "SearchField" (2) create your input field property control "UserInput" (3) create a calculated column [FilteredCustomers] if(find(DocumentProperty("UserInput"),[${SearchField}])>0, [Customer Name]) (4) create your property control multi-select box based on the [FilteredCustomers] column. Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted October 23, 2015 Author Share Posted October 23, 2015 THanks so much. That worked! Link to comment Share on other sites More sharing options...
luo jianping Posted October 20, 2019 Share Posted October 20, 2019 thanks ,that's great 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