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.
Greetings!
I have three things I want to do in Power BI through a single M query.
I know that I can use Web.Contents to perform GET requests, and POST requests by adding the Contents option.
But, according to the SAP documentation, the http request to refresh a webi document has to be a PUT. I confirmed that this works through Postman.
I found the Power Query M function, WebMethod.Put but have not found any mention of how in the heck to use it, or any of the other WebMethod functions.
Does anyone have experience using these WebMethod functions? Or, has anyone been able to successfully update a SAP Webi document before pulling in the data through other means?
Help is appreciated!
Thanks!
-Eric
Has anyone found a solution ?
Hi,
I just found a solution to this problem using an external service called Integromat.
This tool allows you to integrate various applications easily.
I created the following scenario:
That's it.
Hope I helped
Hi @ErockF
Reference here hope to help you.
a sample to send a POST request of the Power BI REST APIs.
Best Regards
Maggie
Hi @v-juanli-msft,
Thank you for your response.
It looks like out of the three links you mentioned, the first two use Contents=Text.ToBinary() as a solution to turn the Web.Contents into a POST and the third looks like a powershell solution.
Maybe I am not reading the posts right, could you provide some more specifics?
Thanks!
Has anyone found a solution to this issue?
Tried WebAction.Request (which seems to be the only possible interface to do a PUT request) and all I get is errors pushed back (see below)...
I'm testing to just try to get webaction to work but it's crapping out on the request itself....
The lack of documentation and examples for the power query/M language is brutal and what you can do within power query is more of a mystery than anything. Someone from Microsoft with knowledge, please chime in...
NOTES:
1) Web.Contents works BUT only supports POST and GET request methods, need access to PUT and DELETE methods
2) Data repository is located behind an oData api
3) Working from within power query advance query editor.
4) Tried OData.Feed as well but the reponse from the api does not have have response header set so that craps out as well AND don't know if it supports allrequest methods as well!
let Source = Text.FromBinary( WebAction.Request("GET","https://myurl.com/db/table", [ Headers=[Accept="application/json",ContentType="application/json",user="***************",password="***********************"] ] ) ), FixJsonRecords="[" & Text.Replace(Text.Replace(Source,"}{","},{"),"{""queryType"":""select""},","") & "]", fixResult=Table.FromRecords(Json.Document(FixJsonRecords)) in fixResult
***** Error *****
Error Message:
Object reference not set to an instance of an object.
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__DisplayClass10.<BeginAnalyzeDocumentPartition>b__d(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__DisplayClass3`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.RemoteDocumentEvaluator.EvaluationThread(Object state)
at Microsoft.Mashup.Evaluator.GlobalizedEvaluatorThreadPool.<>c__DisplayClass4.<Start>b__3(Object s)
at Microsoft.Mashup.Evaluator.EvaluatorThreadPool.EvaluatorThread(Object state)
at Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass2.<CreateThreadStart>b__0(Object o)
at Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass15.<CreateAction>b__14(Object o)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
100 | |
83 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |