Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

WebAction.Request("PATCH"... Object reference error

Dear support, 

 

I get an "Object reference ..." error running this PowerQuery M statement:

 

let
response = WebAction.Request("PATCH", "https://myapiservice.url",
[Headers =
[Authorization="Bearer MyMainSuperSecretToken"]
]
)
//json = Json.Document(response)
in
response 

 

The API service requires me to first get a valid token, by using my main super secret token, and then use that token, which is only valid for 24 hours,  for the data requests. This first call should use the PATCH method. 

 

Am I doing something wrong, is this a bug? Please help. 

 

This is the Details output. 

 

Feedback Type:
Frown (Error)

Timestamp:
2020-06-05T14:02:19.6684409Z

Local Time:
2020-06-05T16:02:19.6684409+02:00

Session ID:
6447df5e-35c6-47fd-88ed-22e3b1e23420

Release:
April 2020

Product Version:
2.80.5803.1061 (20.04) (x64)

Stack Trace:
at Microsoft.Mashup.Host.Document.Evaluation.EvaluationResult.CreateExceptionResult(Exception exception)
at Microsoft.Mashup.Host.Document.Analysis.PackageDocumentAnalysisInfo.PackagePartitionAnalysisInfo.FormulaMetadataRecorder.RecordException(FormulaAnalyzerScope scope, Exception exception, DateTime staleSince, Boolean sampled)
at Microsoft.Mashup.Host.Document.Analysis.PackageDocumentAnalysisInfo.PackagePartitionAnalysisInfo.SetPreviewValue(EvaluationResult2`1 result, Func`1 getStaleSince, Func`1 getSampled)
at Microsoft.Mashup.Host.Document.Analysis.CachingDocumentAnalysisInfo.CachingPartitionAnalysisInfo.SetPreviewValue(EvaluationResult2`1 result, Func`1 getStaleSince, Func`1 getSampled)
at Microsoft.Mashup.DocumentHost.DocumentAnalyzer.Analyze(IPartitionAnalysisInfo partitionInfo, AccessRecorder recorder, EvaluationResult2`1 result, Action`1 callback)
at Microsoft.Mashup.DocumentHost.DocumentAnalyzer.<>c__DisplayClass6_1.<BeginAnalyzeDocumentPartition>b__0(EvaluationResult2`1 result)
at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose(Action`1 callback, EvaluationResult2`1 result, Action action)
at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose[T](Action`1 callback, EvaluationResult2`1 result, Action action)
at Microsoft.Mashup.Evaluator.LimitedDocumentEvaluatorFactory.Evaluation`1.Complete(EvaluationResult2`1 result)
at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose(Action`1 callback, EvaluationResult2`1 result, Action action)
at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose[T](Action`1 callback, EvaluationResult2`1 result, Action action)
at Microsoft.Mashup.Evaluator.LimitedDocumentEvaluatorFactory.Evaluation`1.Complete(EvaluationResult2`1 result)
at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose(Action`1 callback, EvaluationResult2`1 result, Action action)
at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose[T](Action`1 callback, EvaluationResult2`1 result, Action action)
at Microsoft.Mashup.Evaluator.DocumentEvaluator.<>c__DisplayClass7_0`1.<BeginGetResult>b__0(EvaluationResult2`1 result)
at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose(Action`1 callback, EvaluationResult2`1 result, Action action)
at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose[T](Action`1 callback, EvaluationResult2`1 result, Action action)
at Microsoft.Mashup.Evaluator.LimitedDocumentEvaluatorFactory.Evaluation`1.Complete(EvaluationResult2`1 result)
at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.RemoteEvaluation`1.TryComplete(EvaluationResult2`1 result)
at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.PreviewValueSourceRemoteEvaluation.GetResult(Boolean enableFirewall)
at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.RemoteEvaluation.Evaluate(Boolean enableFirewall)
at Microsoft.Mashup.Evaluator.EvaluatorThreadPool.EvaluatorThread(Object state)
at Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass9_0.<CreateAction>b__0(Object o)

PowerBINonFatalError:
{"AppName":"PBIDesktop","AppVersion":"2.80.5803.1061","ModuleName":"Microsoft.Mashup.Document.dll","Component":"Microsoft.Mashup.Host.Document.Evaluation.EvaluationResult","Error":"System.NullReferenceException","MethodDef":"CreateExceptionResult","ErrorOffset":"406"}

OS Version:
Microsoft Windows NT 10.0.18363.0 (x64 en-US)

CLR Version:
4.7 or later [Release Number = 528040]

Peak Virtual Memory:
39.1 GB

Private Memory:
1.04 GB

Peak Working Set:
997 MB

IE Version:
11.836.18362.0

User ID:
5fbb2c50-dc68-4382-9a57-9897dcb02824

Workbook Package Info:
1* - nl-NL, Query Groups: 0, fastCombine: Disabled, runBackgroundAnalysis: True.

Telemetry Enabled:
True

Snapshot Trace Logs:
C:\Users\EdgarWalther(ITsmart\AppData\Local\Microsoft\Power BI Desktop\FrownSnapShot767348760.zip

Model Default Mode:
Import

Model Version:
PowerBI_V3

Is Report V3 Models Enabled:
True

Enabled Preview Features:
PBI_shapeMapVisualEnabled
PBI_NewWebTableInference
PBI_qnaLiveConnect
PQ_AIInsightsFunctionBrowser
PBI_inlineExplore
PBI_realTimeRefresh
PBI_showMinervaRibbon
PBI_showMinervaViewNavigator
PBI_v3ModelsPreview
PBI_decompositionTree
PBI_hierarchicalSlicerCreation
PBI_relativeTimeSlicer

Disabled Preview Features:
PBI_SpanishLinguisticsEnabled

Disabled DirectQuery Options:
TreatHanaAsRelationalSource

Cloud:
GlobalCloud

DPI Scale:
100%

Supported Services:
Power BI

 

Many thanks, 

Status: New
Comments
v-yuta-msft
Community Support

@waltheed ,

 

I'm afraid I couldn't reproduce your issue. I would create a support ticket here for further analysis.

Support Ticket.gif 

Regards,

Jimmy Tao

waltheed
Solution Supplier

OK, thanks. I just did that. 

waltheed
Solution Supplier

I created a workaround, as Microsoft is not going to fix this soon enough for me. 

 

In Power Automated I create a Flow that is able to perform a PATCH http request.
The result of that request is saved in OneDrive.
In Power BI I use the json file frokm OneDrive, get the token part out of that json and use that in the http header of the web request. That works!!

 

hth