使用 PowerApps 调用 Rest API [英] Rest API calls with PowerApps

查看:50
本文介绍了使用 PowerApps 调用 Rest API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Microsoft PowerApps 和 Microsoft Flow.我想弄清楚如何从 PowerApps 进行 API 调用并将结果(状态和正文)返回到我的应用程序中的文本框等字段.

I am playing around with Microsoft PowerApps and Microsoft Flow. I am trying to figure out how to make API calls from PowerApps and return the results(Status and Body) to a field such as a text box in my app.

我可以通过 Flow 发出 HTTP 请求,并将它们放入静态文件中,例如 Excel 电子表格...等.我还可以从 PowerApps 控件(例如按钮)进行调用,但我只知道如何将其返回到 excel 文件之类的内容,当我真的想将其返回到文本框或文本区域时.

I can make the HTTP requests through Flow and put them in a static file such as an excel spreadsheet...etc. I can also make the calls from a PowerApps control such as a button but all I know how to do with it is return it to something like an excel file, when really I want to return it to a Text Box or Text Area.

推荐答案

今天,您无法从 PowerApp 访问原始 HTTP 状态/正文.调用任意"HTTP 端点的方法是使用您可以使用 Swagger 描述的自定义 API.我写了一篇关于如何调用 Azure 函数的快速博客,展示了如何大摇大摆地调用 API:https://powerapps.microsoft.com/en-us/blog/using-azure-functions-in-powerapps/

Today you cannot access the raw HTTP status/body from a PowerApp. The way to call "arbitrary" HTTP endpoints is to use Custom APIs that you can describe using Swagger. I wrote a quick blog on how to call Azure functions that shows how to craft a swagger to call the API: https://powerapps.microsoft.com/en-us/blog/using-azure-functions-in-powerapps/

如果您能阐明您尝试构建的特定场景以查看是否还有其他方法可能会很好,但想到的一个选项是构建一个接收 URL 并在服务器端执行的自定义 APIHTTP 请求并返回对象中的值,然后您可以在 PowerApps 中轻松访问该值.

Might be good if you could clarify the specific scenario you are trying to build to see if there are other ways, but one option that comes to mind is to build a custom API that receives the URL and on the server-side performs the HTTP request and returns the values in an object that then you can easily access in PowerApps.

这篇关于使用 PowerApps 调用 Rest API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆