Get usedrange of Microsoft Graph API doesn't work - excel

I am trying to get values that are stored in Excel cells using the method Get usedrange (see the page below), but it doesn't work.
https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/worksheet_usedrange
The following error response is returned.
{
"error": {
"code": "InvalidArgument",
"message": "引数が正しくない、不足している、または形式が不適切です。", //The argument is incorrect, missing, or the format is inappropriate.
"innerError": {
"request-id": "dcff76b5-9bc6-4a01-b99f-853b9430ef0d",
"date": "2017-05-01T09:01:15"
}
}
}
I tried GET (as opposed to POST) with the same request URL on a trial ......it is mysterious that sometimes were time out, but sometimes all cell data was returned without timeout (result, the browser hung up).
I'd be very appreciated it if I could get any advise from anyone who encounters the same phenomenon or knows how to avoid it.
--
Additional Notes:
-Excel Data
-Execution result in Graph Explorer (original method, POST)
https://graph.microsoft.com/v1.0/me/drive/items/01PYKTZAO2B65SCU2UDJCKMKFWJEEDRNLQ/workbook/worksheets('Sheet1')/UsedRange()
-Additional Information - Result when use GET in the same URL

The author left a comment saying that they only expected metadata (such as the number of cells), but received all of the data in the range.
You can filter which information you'd like back like so:
/usedRange?$select=columnCount,rowCount,address,addressLocal,cellCount,columnIndex,rowIndex
(Doing this prevents the query from returning the actual data from the cells because it omits things like numberFormat, text, formulas, formulasLocal, formulasR1C1, valueTypes, and values.)

Related

Logic App error - ActionFailed. An action failed. No dependent actions succeeded

I'm running into this error - ActionFailed. An action failed. No dependent actions succeeded - when trying to run this logic app to add an IP to be blocked.
Error
I'm not sure where to start. The input looks ok. Help? Thanks in advance!
p.s. - sorry, it won't allow me to post the pics due to not having enough points.
Tried changing some parts of the body. Not sure what to change really.
According to Microsoft's documentation on Submit or Update Indicator API the request body should be as follows:
{
"indicatorValue": "220e7d15b011d7fac48f2bd61114db1022197f7f",
"indicatorType": "FileSha1",
"title": "test",
"application": "demo-test",
"expirationTime": "2020-12-12T00:00:00Z",
"action": "AlertAndBlock",
"severity": "Informational",
"description": "test",
"recommendedActions": "nothing",
"rbacGroupNames": ["group1", "group2"]
}
Since the error you get is too generic, it isn't clear enough to know exactly.
You are not passing in recommendedActions and rbacGroupNames, they may not be required but may want to pass the column even if no value is included.
I would also validate calling this API using manual values (even the exact value from their documentation) and if that does work, use process of elimination to figure out which property is giving you the trouble.
i.e. application might not accept a space value or combining the two values for description should be done outside of the HTTP call using compose and then passed as a single value of the output.

ADF: can't build simple Json file transformation (one field flattening)

I need a help in transforming simple json file inside Azure Data Flow. I need to flatten just one field date_sk in example here:
{
"date_sk": {"string":"2021-09-03"}
"is_influencer": 0,
"is_premium": -1,
"doc_id": "234"
}
Desired transformation:
"date_sk": {"string":"2021-09-03"}
to become
"dateToGroupBy" : "2021-09-03"
I create source stream, note the strange projection Azure picks, there is no "string" field anymore, but this is how automatic Azure transformation works for some reason:
Data preview of the same source stream node:
And here's how it suggest me to transform it in a separate "Derived Column" modifier. I played with the right part, but this is the only format (date_sk.{}) that does not display any error I was able to pick:
But then output dateToGroupBy field happens to be empty:
Any ideas on what could got wrong and how can I build the expected transformation? Thank you
Alright, it happened to be a Microsoft bug in ADF.
ADF stumbles upon "string" field name as JSON field, can't handle it, though schema and data validation passes through Ok, and showing no errors.
When I replace date_sk": {"string":"2021-09-03"} by date_sk": {"s1":"2021-09-03"} or anything other than string everything starts working just fine
and dateToGroupBy is filled with date values taken from date_sk.s1
When I return string back, it shows NULL in output values.
It supposed to either show error on verification stage or handle this field naming properly.

gspread.exceptions.APIError error code 500

I am using the python gspread library to get information off of google sheets. I have had no prior problems accessing any sheets but one sheet keeps throwing this error with doc.worksheet("{worksheet_name}") or doc.worksheets():
gspread.exceptions.APIError: {
"error": {
"code": 500,
"message": "Internal error encountered.",
"status": "INTERNAL"
}
}
I have ruled out the following possible causes:
program doesn't have access to the doc
too many worksheets in the doc
over api limit
I even created a copy of the doc and tried to access that and the same error occurred.
You can use a 100 second delay every 100 requests
Usage limit
Well, I had the same error. I just created another spreadsheet and it worked.
This error is caused because the data is large.You can improvise by uploading the data in chunks but you need to add rows to the sheet of the additional chunks and specify the range in the sheet you want to append the data
i.e
worksheet.update([[]]) #list of lists of first chunk
worksheet.add_rows() #number of rows you want to append
worksheet.update(range,[[]]) #range where you want to place the second chunk and list of the lists of the second chunk

Getting image link to Sharepoint list picture using Microsoft Graph

Im trying to retrieve some information from a Sharepoint list that contains our Company news. I have looked through our columns that exists and realized that the image is located at a column named PublishingRollupImage.
My call to microsoft looks like this:
https://graph.microsoft.com/v1.0/sites/{tenant id}/lists/posts/items?$expand=fields($select=Title,body,DepartmentCompany,PublishingRollupImage)
BUT - if i make this call, the response will be:
{
"error": {
"code": "-1, Microsoft.SharePoint.Client.ClientServiceException",
"message": "Cannot serialize data for type Microsoft.SharePoint.Publishing.Fields.ImageFieldValue.",
"innerError": {
"request-id": "f885269e-da21-45a0-b3e4-e304f4e01edb",
"date": "2018-12-10T12:12:25"
}
}
}
This is of corse due to that i'm getting the whole image sent by adding this. But i read that i could use .ImageUrl to cast it to a link instead, but i'm not sure if this could be done in a call like this.
Has anyone any pointers to give?
The Object Model(CSOM/JSOM) way return object list but not JSON, so it does not need to serialize. Graph way return JSON, it need serialize operation.
No available workaround for this now, so you may not use the field by Graph now. You could submit one feature request on the UserVoice.

Missing value ("is_coach_recommended") in API Khan response

I found that currently the API call corresponding to "/api/v1/user/exercises" doesn't return the value "is_coach_recommended". That says if the corresponding exercise (skill) was recommended or not by the teacher; this in contrast to the example json response example presented in the API explorer (http://api-explorer.khanacademy.org/api/v1/user/exercises) where it does appear.
Do you know how to make it appear? Maybe using a request that queries a previous version of API Khan? That information is critically important for the development of our project so I hope you can help me to make that information back.
Thanks!
It should be documented. Usually an attribute like this would be present with a value of true or false, or it would not be present. And there should be rules describing how you should interpret "not present".
"Should be documented" rarely means it is documented. You might have a look at some data; if out of 1,000 records 500 have a value "true", 500 have no value, and none have a value "false", then clearly "not present" means "false". If you have 400 true, 400 false, 200 not present, then "not present" might mean "not known".

Resources