在Microsoft Dataverse中,是否可以将经常使用的查询存储为OData报表?

huangapple go评论78阅读模式
英文:

Is it possible to store a frequently used query in OData as a report in Microsoft Dataverse?

问题

I have a MS Dataverse query which uses OData to grab a bunch of data from an MS Power App (yes I know).

The OData query is about 800 characters long and is rather cumbersome with a lot of joins and nested selects etc.

My query is always going to be the same, so what I want to do store it as a report or set of pre-populated parameters, so then my OData query is just requesting that report, allowing me to cut the number of characters in the API call to a minimum.

If I was programming properly, and not using this annoying low-code stuff, then I'd name that an API Endpoint. A defined contract that always produces the same data every time. I would give my Endpoint a name like "GetUserData" and that's what I would use.

Is setting up something like this possible in OData / Dataverse, or am I doomed to pass in a huge query string as parameters every single time?

I've searched all over StackOverflow and google etc but the combination of "OData" and "Report" or "Query" just sends me down endless PowerBI rabbit holes.

英文:

I have a MS Dataverse query which uses OData to grab a bunch of data from an MS Power App (yes I know).

The OData query is about 800 characters long and is rather cumbersome with a lot of joins and nested selects etc.

My query is always going to be the same, so what I want to do store it as a report or set of pre-populated parameters, so then my OData query is just requesting that report, allowing me to cut the number of characters in the API call to a minimum.

If I was programming properly, and not using this annoying low-code stuff, then I'd name that an API Endpoint. A defined contract that always produces the same data every time. I would give my Endpoint a name like "GetUserData" and that's what I would use.

Is setting up something like this possible in OData / Dataverse, or am I doomed to pass in a huge query string as parameters every single time?

I've searched all over StackOverflow and google etc but the combination of "OData" and "Report" or "Query" just sends me down endless PowerBI rabbit holes.

答案1

得分: 1

你可以创建一个自定义 API,自定义 API 在这里描述:https://learn.microsoft.com/en-us/power-apps/developer/data-platform/custom-api

实际上,你将你的代码封装在自定义 API 中,然后只需调用自定义 API(还可以定义输入参数),以获取结果(通过使用输出参数)。

英文:

You can create a custom API, custom API are described here
https://learn.microsoft.com/en-us/power-apps/developer/data-platform/custom-api

practically you encapsulate your code inside the custom API and you just call the custom API (you can also define input parameters) in order to get the result (by using an output parameter).

答案2

得分: 0

根据odata查询的复杂性,您还可以将其保存为使用高级查找的个人视图。

英文:

Depending on the complexity of the odata query, you could also just save this as a Personal View using Advanced Find

huangapple
  • 本文由 发表于 2023年8月10日 17:06:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/76874217.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定