Create cfquery object from HTML table - coldfusion

I know this sounds backwards... yes, I want to know how to create a cfquery object from an already created HTML table. Here's my use case:
1) I've created a cfquery object and have some data
2) I've looped over the cfquery and created the HTML table
3) Now I've run some custom javascript to add more columns to the HTML table (e.g., my original cfquery had week number and I wanted to add Week Day monday-based so I did that)
4) So now I have an HTML table that is different from my cfquery object and I want to create an export of the data in the HTML table using some cfscript I already have but the cfscript takes in cfquery
Now I'm stuck at this so called step 4. What's the best way to create a cfquery object from HTML table sort of reverse engineering that back into a cfquery object?

Doing all of that server side is the way to go. But answering the original question just for giggles...
What you could do is serialize the table data into json format.
Convert a HTML table data into a JSON object in jQuery
Send that to CF with a POST operation.
Then deserialize the post data into a query object.
https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-c-d/DeserializeJSON.html

Related

How can I get my PBI report to populate each query result on a new page?

Relative NEWB to PowerBI report builder and have a question about report iteration. Basically, I have a dataset that contains data for 'scorecards'. I want each page of the report to be one 'scorecard'. This corresponds to each row in my dataset query accordingly. I formatted my report accordingly and was anticipating that when I linked each textbox to its corresponding dataset field, when I run the report, I would have a multi-page report; however, I'm only seeing the first query result. I'm assuming this has something to do with the first() function. What am I missing?
edit - I'm basically trying to recreate the functionality of an Access 'report' where each record is displayed on a new report page.
I figured this out - it was staring right in front of me! I needed to add a 'List' data region. I can then design the report and it creates a new page for each record.

Superset display dynamic content from query (markdown)

I would like to display a chart in a dashboard displaying text. The text value is retrieved from a query.
e.g.
I have the following query:
SELECT MAX(update_date) FROM my_data_tbl
I would like to create a box (inside the dashboard) like this one:
I've tried with the 'Markdown Chart' but i don't understand how to dynamical push data into the component
I don't think getting data into the markdown "chart" is currently possible. The markdown is more for adding text to a dashboard.
One hacky way to do this could be to use the Table chart type. Values in a table can use html. You'll most likely have to do some awkward string manipulation using SQL to get html into your query results, but it works.

How to transfer the value from the filter to Power Query and insert it into the query?

I have a report that displays data for a certain period. There are two parameters in the report: the start date and the end date. Data is displayed for the specified period. I want to dynamically load data using a filter in the report, rather than changing the parameters of the query. How can this be implemented?
You can set up a Direct Query where it pulls in the data only when it needs it.
Note that you can have a composite model where some tables are Direct Query and others are Import.

Variable in a Power BI query

I have a SQL query to get the data into Power BI. For example:
select a,b,c,d from table1
where a in ('1111','2222','3333' etc.)
However, the list of variables ('1111','2222','3333' etc.) will change every day so I would like the SQL statement to be updated before refreshing the data. Is this possible?
Ideally, I would like to keep a spreadsheet with a list of a values (in this example) so before refresh, it will feed those parameters into this script.
Another problem I have is the list will have a different nr of parameters so the last variable needs to be without a comma.
Another option I was considering is to run the script without the where a in ('1111','2222','3333' etc.) and then load the spreadsheet with a list of those a's and filter the report down based on that list however this will be a lot of data to import into Power BI.
It's my first post ever, although I was sourcing help from Stackoverflow for years, so hopefully, it's all clear.
I would create a new Query to read the "a values" from your spreadsheet. I would set the Load To / Import Data option to Only Create Connection (to avoid duplicating the data).
Then in your SQL query I would remove the where clause. With that gone you actually don't need to write custom SQL at all - just select the table/view from the Navigation UI.
Then from the the "table1" query I would add a Merge Queries step, connecting to the "a values" Query on the "a" column, using the Join Type: Inner. The resulting rows will be only those with a matching "a" column value (similar to your current SQL where clause).
Power Query wont be able to send this to your SQL Server as a single query, so it will first select all the rows from table1. But it is still fairly quick and efficient.

Insert Csv file values into table apex

I am trying to insert bulk values into the table through an excel.csv file.
I have created a file browser item on the page, now in the process have to write insert code for this to insert the excel values into the table.
the following table I have created: NON_DYNAMIC_USER_GROUPS
columns: ID,NAME,GROUP,GROUP_TYPE.
Need to create insert process code for this.
I prefer the Excel2Collection plugin for converting any form of Excel document into rows in an Oracle table.
http://www.apex-plugin.com/oracle-apex-plugins/process-type-plugin/excel2collections_271.html
PL/SQL already written, and formulated into an APEX plugin, making it easy to use.
It is possible to uncompress the code and convert it to using your own table, instead of apex_collections, which are limited to 50 columns/fields.