【问题标题】:Base64 images from SharePoint multi-line text to PowerApps从 SharePoint 多行文本到 PowerApps 的 Base64 图像
【发布时间】:2021-12-02 03:58:26
【问题描述】:

基本上,我正在尝试通过 SharePoint 中存储 base64 图像的多行文本字段在 Power Apps 中设置图像。

SharePoint 中的多行文本字段存储 base64 图像,如 "data:image/png;base64,iVBORw0KGgoAAAANSUhEU......."

我通过执行 Patch 并使用此 JSON 公式 JSON(penFullMapDrawing.Image, JSONFormat.IncludeBinaryData) 将这些图像从 PowerApps 上传到 SharePoint 条目。

  • base64 图像成功写入 SharePoint,当我将 SharePoint 中的 base64 文本复制并粘贴到 PowerApps 中图像的 Image 属性时,它会显示正确的图像

  • 问题在于,当我尝试通过 LookUp 函数设置 Image 属性以从 SharePoint 检索 base64 文本时,即使它抓取了正确的文本,图像也不会显示在 PowerApps 中。。 p>

任何想法如何使这项工作或这里发生了什么?

【问题讨论】:

    标签: sharepoint powerapps


    【解决方案1】:

    这可能对您有所帮助。我还通过 Base64 数据设置 Image 属性,但它是通过 JSON 调用。它返回以下数据:

    {
      "$content-type": "image/png",
      "$content": "iVBORw0...="
    }
    

    $content 是 Base64 数据,我使用 outputs() 将其解析为变量并通过 Power Automate 发送到我的画布应用程序。我的图像控件的 Image 属性设置为该变量,并且直接将 Base64 数据提供给它可以很好地更新控件。 Power Automate 的输出如下所示:

    "variable": "iVBORw0...=" 这在没有内容类型标签的情况下有效。

    那么也许您可以尝试创建 SharePoint 流而不是使用 LookUp?

    【讨论】:

    • 这似乎是一个可靠的解决方案,但我发现了另一种更接近我原来方法的解决方法。有关详细信息,请参阅我的答案。谢谢!
    【解决方案2】:

    问题在于 base64 图像周围的“s”。

    我不得不将我的 LookUp 函数修改为 Substitute(LookUp(), “”””, “”) 并且它按预期工作。

    【讨论】:

      猜你喜欢
      • 2018-04-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-06
      • 1970-01-01
      • 2011-03-17
      相关资源
      最近更新 更多