ホーム › フォーラム › Power Apps › 関数など › 選択した画像をPower AutomateのApproveを用いて添付
-
投稿者投稿
-
2020-02-11 21:17 #5192コルネ参加者::
こちらに投稿するのであっているのかわかりませんが、Power AppsとPower Automateの連携に関して質問させていただきます。
Power Apps側で、「画像の追加」により撮影、もしくは選択された画像をPower AutomateのApprove関数の「Attachments Name」及び「Attachments Contents」を用いて添付画像として送信したいと考えています。
【試したこと】
・設定値
Power Apps側からデータをPower Automate側に投げる際の設定(.Run())
Attachments Name :AddMediaButton.FileName
Attachments Contents:AddMediaButton.MediaPower Automate側のApproveの設定
Attachments Name :Power Appsから取得した値
Attachments Contents:Power Appsから取得した値>実行結果
画像データが開けない——————————————————–
・設定値
Power Apps側からデータをPower Automate側に投げる際の設定(.Run())
Attachments Name :AddMediaButton.FileName
Attachments Contents:JSON(AddMediaButton.Media, IncludeBinaryData)Power Automate側のApproveの設定
Attachments Name :Power Appsから取得した値
Attachments Contents:Power Appsから取得した値>実行結果
画像データが開けない——————————————————–
・設定値
Power Apps側からデータをPower Automate側に投げる際の設定(.Run())
Attachments Name :AddMediaButton.FileName
Attachments Contents:AddMediaButton.MediaPower Automate側のApproveの設定
Attachments Name :Power Appsから取得した値
Attachments Contents:dataUriToBinary(Power Appsから取得した値)>実行結果
フローの失敗。
エラー内容
‘dataUriToBinary’ のパラメーターは有効なデータ URI として書式設定する必要があります。指定された値 ‘appres://blobmanager/*****/*’ は正しく書式設定されていません。——————————————————–
——————————————————–・設定値
Power Apps側からデータをPower Automate側に投げる際の設定(.Run())
Attachments Name :AddMediaButton.FileName
Attachments Contents:JSON(AddMediaButton.Media, IncludeBinaryData)Power Automate側のApproveの設定
Attachments Name :Power Appsから取得した値
Attachments Contents:dataUriToBinary(Power Appsから取得した値)>実行結果
‘dataUriToBinary’ のパラメーターは有効なデータ URI として書式設定する必要があります。指定された値 ‘”appres://blobmanager/*****/*”‘ は正しく書式設定されていません。——————————————————–
エラー内容より、書式設定が正しくないということはなんとなくわかりましたが、リファレンスなどを確認してもいまいちどのように設定すればよいのかわかりませんでした。
よろしければご助力の程よろしくお願い致します。
2020-02-12 01:32 #5193コルネ参加者::本件ですが、自己解決致しました。
解決方法としまして、まずそもそも「画像の追加」コントロールの”Media”をPower Automateに渡そうとしてるのがいけませんでした。
こちらのコントロールですと、”appres://blobmanager/*******/*”の文字列でしか送ることができません。
なので、一度「画像」コントロールにこちらの「画像の追加」コントロールで追加した画像を表示させ、”Image.Image”のようにしたものに対して、さらに”JSON(Image.Image, IncludeBinaryData)”に変換してあげた値をpower Automate側に渡す必要がありました。また、このままでは、””data:image/jpeg;base64,/…””と前後に余分なダブルクォーテーションが存在し、”dataUriToBinary()”が正常に動作しないため。”Replace()”を用いて置換する必要がありました。
詳しくはまた別の機会に調べて纏めたいと思います。
ありがとうございました。
2021-11-20 17:18 #6042ka参加者2021-11-21 18:19 #6043コルネ参加者::お役に立てたようでよかったです!
>「”Image.Image”のようにしたものに対して」
こちらに関してですが、私のブログの紹介となり恐縮ですが以下記事が参考になるかと思います。
https://koruneko.hatenablog.com/entry/2021/07/11/1224562021-11-25 17:28 #6053 -
投稿者投稿
- このトピックに返信するにはログインが必要です。