Workaround for XLSM issues - sql

My company receives a daily CDR report from Comcast and I'm trying to get this data into our database in an automated fashion. Unfortunately, Comcast has advised there is a 0% chance they send us a CSV or XLSX or anything that is NOT an XLSM. For some context, Comcast's CDR report is several sheets but I need only the data from Sheet1 (called All CDR) and there are NO macros in sheet1.
So, I have been working all week on a workaround. During testing I was able to get this code to work:
SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0 Macro;
Database=\\\fileserver\Comcast.xlsm;IMEX=1;HDR=YES','select * from [All CDR$]')
NOTE: This only reads the data, I will turn it into an INSERT statement once working.
But I found out that this code ONLY works if the file has been opened and saved. I.e. I had to open the file, enable content, then Excel asks "Do you want to make this file a trusted document?" which I click Yes, then save and exit. Then the code works.
So how can I work around this awful issue courtesy of Comcast? I have Power Automate at my disposal as well as SQL Server and other standard business tools. I have tried using power automate to read the excel file but this has failed as Sharepoint would not recognize the XLSM files, only XLSX. I wanted to use power automate to open the Excel file, save it and close it but I do not think this is possible. Thanks in advance

If you can't find a nicer way then you can do this using an Office Script. It may or may not work as you need it but you can work through that.
If you go into Excel Online (any workbook) under the user that will run the script in PowerAutomate, you should have an option in the ribbon called Automate.
Find it and create a new script called ... Get All Data from Worksheet
Paste this code in ...
function main(workbook: ExcelScript.Workbook, worksheetName: string)
{
let worksheet = workbook.getWorksheet(worksheetName);
let usedRange = worksheet.getUsedRange(true);
return usedRange.getValues();
}
Now, you can call that from PowerAutomate using the Run script action under Excel Online (Business) ...
Action
Result
JSON Response
[
[
"Header 1",
"Header 2",
"Header 3",
"Header 4",
"Header 5",
"Header 6",
"Header 7"
],
[
"21",
"22",
"23",
"24",
"25",
"26",
"27"
],
[
"31",
"32",
"33",
"34",
"35",
"36",
"37"
],
[
"41",
"42",
"43",
"44",
"45",
"46",
"47"
],
[
"51",
"52",
"53",
"54",
"55",
"56",
"57"
],
[
"61",
"62",
"63",
"64",
"65",
"66",
"67"
],
[
"71",
"72",
"73",
"74",
"75",
"76",
"77"
],
[
"81",
"82",
"83",
"84",
"85",
"86",
"87"
],
[
"91",
"92",
"93",
"94",
"95",
"96",
"97"
],
[
"101",
"102",
"103",
"104",
"105",
"106",
"107"
],
[
"111",
"112",
"113",
"114",
"115",
"116",
"117"
]
]
From there, you can do what you need with the data.

Related

[Xero][Quote] Can not store tracking category option for quote line item

I have the issue when creating or updating the Quote. I can not set TrackingCategory options for line items. I request api like document but it not success.
The Tracking Category I have
tracking category
Here is my expected:
my expected
Please help me
Thanks you
Here is format payload for lineItems
"LineItems": [
{
"AccountCode": "200",
"Description": "Development work - developer onsite per day",
"UnitAmount": 650.0000,
"DiscountRate": 10.00,
"LineAmount": 585.00,
"ItemCode": "DevD",
"Quantity": 1.0000,
"TaxAmount": 58.50,
"TaxType": "OUTPUT",
"Tracking": [
{
"Name": "Location",
"Option": "Foo Bar"
}
]
}
],

Mismatching phase size in tls when setting up more than one lane in Simple Grid Scenario

I am modifying SimpleGridScenario class in ../flow/scenarios/grid.py and .../examples/rllib/green_wave.py so that I can turn my simple grid into a double lane per corridor scenario. I added them and I also set up new connections so that vehicles can turn right and left. This is shown in the attached image. For every approach, the first lane allows vehicles to turn left and go straight on and the second one allows vehicles to turn right and go straight on as well.
Unfortunately, every time I run a simulation I receive the following error:
Error: Mismatching phase size in tls 'center0', program 'online'.
Quitting (on error).
Sample node in the grid
connections in NETEDIT
Phases in SUMO
Does anyone know why?
I've verified the phase size in sumo-gui and it is 16, what is correct since I have 4 possible movements per approach.
SimpleGridScenario > __init__()
phases = [{
"duration": "25",
"minDur": "8",
"maxDur": "45",
"state": "GGGgrrrrGGGgrrrr"
}, {
"duration": "7",
"minDur": "3",
"maxDur": "6",
"state": "yyygrrrryyygrrrr"
}, {
"duration": "6",
"minDur": "3",
"maxDur": "6",
"state": "rrrGrrrrrrrGrrrr"
}, {
"duration": "7",
"minDur": "3",
"maxDur": "6",
"state": "rrryrrrrrrryrrrr"
}, {
"duration": "25",
"minDur": "8",
"maxDur": "45",
"state": "rrrrGGGgrrrrGGGg"
}, {
"duration": "7",
"minDur": "3",
"maxDur": "6",
"state": "rrrryyygrrrryyyg"
}, {
"duration": "6",
"minDur": "3",
"maxDur": "6",
"state": "rrrrrrrGrrrrrrrG"
}, {
"duration": "7",
"minDur": "3",
"maxDur": "6",
"state": "rrrrrrryrrrrrrry"
}]
for i in range(self.row_num * self.col_num):
node_id = "center"+str(i)
traffic_lights.add(node_id, phases=phases, tls_type="actuated")
Files can be downloaded in the following link: Flow files
Do not forget to replace the __init__.py file by yours in the scenario directory!
UPDATE: It seems that there might be an online modification of the TLS, probably by Traci. For further details please check this (last comment): Click here
would you be able to attach the image? This would help a lot in figuring this out.
For some phases (like the last one) MaxDur is less than the duration. Try increasing MaxDur or reducing duration.
You can right click in sumo on a traffic light (green or red bar) and "Show phases" to see how long the "state" string should be (as many as the number of rows in the window that opens).
It turns out that the phase size was correct, but my flow environment ( green_wave_env.py ) was setting the traffic light state in the 'online' program with a bad phase size. It works now.
Thank you!

Get specific fields from Rally API for Feature

I am fetching the data using below API :
https://rally1.rallydev.com/slm/webservice/v2.0/PortfolioItem/Feature/?fetch=ObjectID,FormattedID,Name,Parent&pagesize=2000
I don't want to fetch all fields in Parent. All I need Name,FormattedID,ObjectID,Parent.ObjectID,Parent.Name of Feature. A
{
"_rallyAPIMajor": "2",
"_rallyAPIMinor": "0",
"ObjectID": blabla,
"FormattedID": "F3792",
"DirectChildrenCount": 23,
"Name": "Phase 2: Fork Messages (New flow of messages that will feed data to 8 reports for D&P)",
"Parent": {
"_rallyAPIMajor": "2",
"_rallyAPIMinor": "0",
"_ref": "https://rally1.rallydev.com/slm/webservice/v2.0/portfolioitem/portfolio/blabla",
"_refObjectUUID": "8fae",
"_objectVersion": "67",
"_refObjectName": "blabla",
"ObjectID": blabla,
"FormattedID": "P1ABC",
"DirectChildrenCount": 13,
"Name": "blabla",
"_type": "PortfolioItem/Portfolio"
},
"_type": "PortfolioItem/Feature"
}
This is just the way the Web Services API works. Any fields included in the fetch will be returned on any object that has them. This is very useful for being able to hydrate fields on associated objects- Parent, Iteration, etc.

Yodlee getSiteLoginForm API response changes between attempts

There seems to be an inconsistency with the responses for Yodlee's getSiteLoginForm REST API function.
For a site that has a login field with radio buttons, sometimes the data coming back from Yodlee for that particular field will look like this:
{
"fieldInfoList": [
{
"validValues": [
"1",
"2",
"3",
"4"
],
"displayValidValues": [
"1",
"2",
"3",
"4"
],
"valueIdentifier": "OPTIONS",
"valueMask": "LOGIN_FIELD",
"fieldType": {
"typeName": "OPTIONS"
},
"size": 20,
"maxlength": 40,
"name": "OPTIONS",
"displayName": "Issue Number",
"isEditable": true,
"isOptional": false,
"isEscaped": false,
"helpText": "76367",
"isOptionalMFA": false,
"isMFA": false
}
]
}
and other times it looks like this:
{
"validValues": [
"1",
"2",
"3",
"4"
],
"displayValidValues": [
"1",
"2",
"3",
"4"
],
"valueIdentifier": "OPTION",
"valueMask": "LOGIN_FIELD",
"fieldType": {
"typeName": "OPTIONS"
},
"size": 20,
"maxlength": 40,
"name": "OPTION",
"displayName": "Issue Number",
"isEditable": true,
"isOptional": false,
"isEscaped": false,
"helpText": "76367",
"isOptionalMFA": false,
"isMFA": false
}
It's the same field but the valueIdentifier value has changed and the data isn't being enclosed in a fieldInfoList variable.
What would be the reason for this response data-set changing between two attempts if there's no difference in the code?
In addition to that, could a similar response inconsistency be affecting other API functions from Yodlee, and if so how does one deal with this uncertain variance?
We did analysis and Yodlee provides every time same response, no matter how many attempts you'll do. While I am assuming that you might be confused between getSiteLoginForm and getLoginFomForContentService, as both are two different APIs and belongs to approach i.e., Site Based and Container Based respectively. And the response you have mentioned first comes when you use getSiteLoginForm while the later one comes with getLoginFormForContentService.
Hope this helps as there is no issue with the API, these are two different response from 2 different APIs.

How can I get a list of all the projects in our Rally instance via the REST API?

How can I query our Rally instance for all of our available projects?
Output from REST call https://rally1.rallydev.com/slm/webservice/1.29/subscription.js?fetch=Workspaces,Name,Projects&pretty=true
...
"Workspaces": [
{
"_rallyAPIMajor": "1",
"_rallyAPIMinor": "29",
"_ref": "https://rally1.rallydev.com/slm/webservice/1.29/workspace/1376977801.js",
"_objectVersion": "10",
"_refObjectName": "Workspace 1",
"Name": "Workspace 1",
"Projects": [ {
"_rallyAPIMajor": "1",
"_rallyAPIMinor": "29",
"_ref": "https://rally1.rallydev.com/slm/webservice/1.29/project/2510231094.js",
"_objectVersion": "3",
"_refObjectName": "Layout",
"Name": "Layout",
"_type": "Project"
}],
"_type": "Workspace"
},
{
"_rallyAPIMajor": "1",
"_rallyAPIMinor": "29",
"_ref": "https://rally1.rallydev.com/slm/webservice/1.29/workspace/1462743357.js",
"_objectVersion": "8",
"_refObjectName": "Bugzilla Workspace",
"Name": "Bugzilla Workspace",
"Projects": [ {
"_rallyAPIMajor": "1",
"_rallyAPIMinor": "29",
"_ref": "https://rally1.rallydev.com/slm/webservice/1.29/project/2510231094.js",
"_objectVersion": "3",
"_refObjectName": "Layout",
"Name": "Layout",
"_type": "Project"
}],
"_type": "Workspace"
},
...
Update #2
The user account being used for the API calls is indeed a subscription admin. I tried a few things with our admin to try and narrow down the problem as to what is occurring and noted a few things:
The projects that are getting returned in the call, are not projects that the api user is a team member of
When we assigned a story to the api user and refreshed the result of the REST call, the projects that were returned in every workspace were identical and seemed to be all of the projects from the given workspace of the project that we assigned the story from. For example, I've pasted the top part of a return: http://khayes.privatepaste.com/cfc730dcf8
It appears this particular REST call has a bug in it.
This should be possible by querying on type 'Subscription'. Make sure you include Workspaces and Projects (and any other data you might want like Name) in your Fetch.
https://rally1.rallydev.com/slm/webservice/1.29/subscription.js?fetch=Workspaces,Projects,Name&pretty=true
The results should look something like this:
{
_ref: "/subscription/1.js",
_refObjectName: "My Subscription",
Workspaces: [
_ref: "/workspace/2.js"
_refObjectName: "My Workspace",
Projects: [
{
_ref: "/project/3.js"
_refObjectName: "Project 1"
}
]
]
}
The REST URL would look like this
https://rally1.rallydev.com/slm/webservice/1.29/subscription?fetch=Workspaces,Name,Projects
I tried in postman with basic authentication: username and password of rally:
All APIs are inter related : let us see step by step and always notice the _ref in your response.
Step 1: First you want the subscription.
https://rally1.rallydev.com/slm/webservice/v2.0/subscription?fetch=Workspaces,Name,Projects
It will return subscription ID suppose it is X.
Step 2: Find the workspaces in that subscription. Put X value as subscription shown below.
https://rally1.rallydev.com/slm/webservice/v2.0/Subscription/X/Workspaces
It will return the workspace id. Let us say it Y.
Step 3: Find the projects in the workspace.
https://rally1.rallydev.com/slm/webservice/v2.0/Workspace/Y/Projects?fetch=ObjectID
There will be URLs in the response which refers to your projects associated to your workspace.
OR,
if you know your workspace ID then use below api: your_WS_id= your workspace ID in below request. just replace this.
https://rally1.rallydev.com/slm/webservice/v2.0/Workspace/your_WS_ID/Projects?fetch=Name
I hope it helps.