Loanne Noirot Posted May 4, 2023 Share Posted May 4, 2023 I have a licence spotfire developer Link to comment Share on other sites More sharing options...
Fredrik Rosell Posted May 4, 2023 Share Posted May 4, 2023 Hello,The JavaScript API, which is a separate thing from the Spotfire.NET client API used by IronPython and C#, has a DataTable.getDataColumns method - https://docs.tibco.com/pub/sfire_dev/area/doc/api/TIB_sfire_Web_Player_JavaScript_API_Reference/html/M_spotfire_webPlayer_DataTable_getDataColumns.htm - which gets all data columns in a table Link to comment Share on other sites More sharing options...
Loanne Noirot Posted May 4, 2023 Author Share Posted May 4, 2023 Thank you to lead me :) Link to comment Share on other sites More sharing options...
Loanne Noirot Posted May 9, 2023 Author Share Posted May 9, 2023 About spotfire.webPlayer.DataTable. If i have several tables, how can i specify the wished table named "table1", i try something but i have undefined object or error like "Message: applyFunc.bind is not a functionStacktrace: TypeError: applyFunc.bind is not a function at spotfire.webPlayer.DataTable ". Is it really as simple as Document.Data.Tables["table1"].Columns (IronPython)? Link to comment Share on other sites More sharing options...
Fredrik Rosell Posted May 9, 2023 Share Posted May 9, 2023 Hello again!To get a specific data table, you can use the getDataTable method (https://docs.tibco.com/pub/sfire_dev/area/doc/api/TIB_sfire_Web_Player_JavaScript_API_Reference/html/M_spotfire_webPlayer_Data_getDataTable.htm)Here's an example where I first get a data table named "SalesAndMarketing" and then the "Store Name" data column from that. doc.data.getDataTable("SalesAndMarketing", function(dataTable) { console.log("This is the data table: " + dataTable.dataTableName); dataTable.getDataColumn("Store Name", function(dataColumn) { console.log("This is the data column: " + dataColumn.dataColumnName ); }); }); For learning more - seeing concrete examples - about how to use the JavaScript API, I recommend taking a look at the "Test Utility Example for the TIBCO Spotfire® JavaScript API" page:https://community.spotfire.com/s/article/test-utility-example-tibco-spotfire-javascript-api?t=1683646587699 Link to comment Share on other sites More sharing options...
Loanne Noirot Posted May 10, 2023 Author Share Posted May 10, 2023 Thanks Fredrik, ```{js}var serverUrl = "https://spotfire-next.cloud.tibco.com/spotfire/wp/";var analysisPath = "/Samples/Expense Analyzer Dashboard";var customizationInfo = new spotfire.webPlayer.Customization();var app = new spotfire.webPlayer.Application(serverUrl, customizationInfo, analysisPath);var doc=app.openDocument("container3");doc.data.getDataTable("SalesAndMarketing", function(dataTable) { return dataTable.dataTableName; });document.getElementById("container3").innerHTML = doc.data.getDataTable("SalesAndMarketing"); ```that was a try, but i don't have succes.my initial purpose is : retrieve the data of my table, not data from a spotfire cloud, i want manipulate, reorganize the value on my column, just like iron python. I try to pass value from iron python but this is million of row, it's just delusional. Link to comment Share on other sites More sharing options...
Fredrik Rosell Posted May 10, 2023 Share Posted May 10, 2023 Hello!For my quick test of this, I simply used the Getting Started example from the TIBCO Spotfire® JavaScript API Overview page: https://community.spotfire.com/s/article/TIBCO-Spotfire-JavaScript-API-Overview#gettingstarted - I strongly recommend that you look at that for a starting point. In summary:1. Create the application (spotfire.webPlayer.createApplication)2. In the onReadyCallback, if successful, you get the application object3. Open the document (app.openDocument())(Yes, doc is the document) Link to comment Share on other sites More sharing options...
Fredrik Rosell Posted May 10, 2023 Share Posted May 10, 2023 Example code attached (point to your server, and a suitable analysisPath). Again, this is simply based on the Getting Started example. Link to comment Share on other sites More sharing options...
Loanne Noirot Posted May 10, 2023 Author Share Posted May 10, 2023 thank you for your time Fredrik 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