How to use a web service as a datasource in Spotfire - sql-server

There is a use case in which we would like to add columns from the data of a webservice to our original sql data table.
If anybody has done that then pls do comment.

Shadowfax is correct that you should review the How to Ask guide.
that said, Spotfire offers this feature in two ways:
use IronPython scripting attached to an action control to retrieve the data. this is a very rigid solution that offers no caching, and the data must be retrieved and placed in memory each time the document is opened. I'll leave you to the search feature here on SO; I've posted a sample document somewhere.
the ideal solution is to use a separate product called Spotfire Advanced Data Services. this data federation layer can mashup data and perform advanced, custom caching based on your needs. the data is then exposed as an information link in Spotfire Server. you'll need to talk to your TIBCO sales rep about this.

I would use a Web Server to consume the Web Service and write it to your DB.
But here is the hard way:
Step 1: Use IronPython Script to retrieve WS Data, and form a Data Table or Document Property (https://www.tibco.com/blog/2014/03/03/streaming-xml-and-json-data-from-the-web-directly-into-spotfire-clients-using-script-controls/)
Step 2: Write a Stored Procedure in your DB and use IronPython to call the procedure (using a button, so this will be a manual step) and pass the Data Table or Document Property as parameter. (Here is an ironpython alternative: http://spotfired.blogspot.com/2014/04/write-back-to-database-from-spotfire.html)

Related

How to gather complete object schema with Mulesoft Salesforce connector (Mule 4)

...I'm using the Mule Salesforce connector (for Mule Runtime 4.4.2) in Anypoint Studio (7.4.2).
The Salesforce query language does not allow the * operator to gather all keys from an object, so I'm looking for another means to retrieve a sample object and create a model record that I could use for updates and creation.
Using the Task object (documented here: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_task.htm) as an example, I find that the describeLayout() and retrieve() methods look promising.
However, when I try to invoke retrieve(), I'm required to submit a list of fields to retrieve.
I don't see the describeLayout() method exposed in the connector, so I haven't seen what it returns.
Have I missed a general purpose approach to allow me to gather every field from a sample object?
[edited for clarity]
See if there's describe support. describeLayout is primarily used if you need to recreate a SF page in a mobile app for example, won't tell you much about field types and will list only fields the end user can see, there can be more hidden in the background.
You could have some luck with REST API describe: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_describe.htm
Or metadata API: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_describesobjects_describesobjectresult.htm
I don't know what's available for you. I'd expect Mule connector to do it for you as part of some connection wizard, pull info about all queryable tables and after you pick one - about all fields you can see in it. Maybe you're overcomplicating something, you need a truly dynamic SELECT * equivalent, that would work when admin adds new fields without having to refresh the connection?
Metadata can also be queried, it's stored in tables like actual data. See if https://stackoverflow.com/a/60067076/313628 helps.
...so it turns out that the Mule 4 Salesforce connector does support describe SObject.
To the Anypoint Studio developer, it shows up like this:
The XML definition offers little further insight.
Update: After further investigation, it turns out that an additional operation needs to be applied using Dataweave to get a simple list of fields. After you have the SObject structure in payload, you will:
payload.fields.*name
This yields an array with the field names.

Print a form from asp.net core 2.0 for customer

We are searching for a solution for the following problem:
We gather some data on our website via an HTML form. This data shall be used for creating a form which in the end shall be printed and physically signed. The data is stored in an MSSQL database.
We don't know which is the best and easiest to implement approach. We thought about having a PDF template and replacing some tags with the values of the database, creating a custom view and print it with 3rd party software or even use an SSRS server.
The most important points are the following:
easy to use for the user
the user shall not be able to change the document after he downloaded it
the document should not be stored on the server (we prefer to have the document created only in the RAM)
if we have to use third party software it should be free of charge
the implementation effort should be as little as possible
Kind regards

How to insert to database using silverlight Dataset

How can I enter dataset into the database using data
An example please
You can't access a database directly from a Silverlight client. There are several ways to accomplish this but you basically need to call a web service from Silverlight. See the following article for a step by step example: https://technet.microsoft.com/en-us/library/cc197937(VS.95).aspx

What is the best way to copy and compare data received from Web API request to SQL Server database?

There is a requirement in my project where we need to design a system which can collect data through Web API and then use the data to compare and copy the received data to an existing SQL Server DB. I want to know if anyone has already worked on such requirement and if yes then what is the best way to design it? I am currently thinking of below two options. Please let me know which one is better and if there is any other option.
My algorithm will be as - fetch the data through web api -> compare the data -> save mismatched data to a particular table -> copy new data to the existing tables.
The two options I am currently thinking of are-
1) Use a windows service which will run once in a day and execute above algo.
2) Use SSIS package which will run once in a day and execute above algo.
If anyone has used either of this solution, please guide me to an article or blog which can be helpful to me.
I have similar project requirement before. What I achieved is in SSIS.
Brief steps:
Using C# script to get the return data (http://json2csharp.com/ is an easy way to return C# class based on your JSON components)
using third party dll, install Newtonsoft.Json to deserialize the JSON
Assign the results in C# script to each pre defined variable (be careful with the data type)
Compare the result with the existing table in data flow task.
Let me know if you have any questions

How do I elegantly import an Excel file into Sql Server via a Coldfusion HTML form?

Does anyone have an elegant suggestion for how to get the contents of an Excel spreadsheet into SQL Server via a web form? I need to allow our clients to upload modest amounts of structured data, and I need that data to ultimately reside in a sql table. I really can't expect the clientele to produce anything but an Excel file, but I could require that it be an xlsx.
The web app is written in Coldfusion; it doesn't need to be able to handle huge numbers of simultaneous requests, but I don't want to consider some sort of server-side batch job processing or shunt the user to an asp.net page (which is what we are doing now).
Any recommendations (or examples of how others are successfully doing this) would be appreciated. Due to the sensitivity of the data, we really can't do anything to compromise the security of the web or sql servers.
If you are using CF9, then you could easily use the cfspreadsheet tag too. I mention this one specifically because Shawn's link did not (presumably due to its being relatively new on the CF scene). Here's the livedoc link: http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec17cba-7f87.html
For full use, I would create a web form with a standard file upload field. On the backend handling the form submission, get a copy of the file with
<cffile action="upload" destination="uploaded.xls".....>
Then use:
<cfspreadsheet action="read" query="myExcelData" src="uploaded.xls" ...>
At which point, your spreadsheet content will be available as a query object. You can then loop over this query, running insert queries into your sql server each time you loop. That should do it.
Here are the most notable options to help point you in the right direction; choose what you are most comfortable with (Source: Charlie Arehart).
CFXL
JXLS
CFX_Excel
My personal recommendation is to go the CFX_Excel route. Although a commercial product, it will grant you the most functionality/flexibility of the options listed.

Resources