I have built a flow in PAD that takes a screenshot of a window as it runs. I know the screenshot is there because if I open a word doc I can paste it with CONTROL +V. The steps after the screenshot launch Outlook and then Send email message through Outlook .
I can't figure out how to get the captured screenshot (stored to clipboard) in the body for the email. My first thought was to capture Send Keys {CONTROL}({V}) as a variable and them put the variable in the body or save the the screenshot as the variable and apply it to the body.
Are either of those options possible?
You cannot "paste" it into an action like that. If you want something that is stored in the clipboard to be pasted anywhere, you would need to automate the User Interface and send Ctrl+V to paste it. So, you would need to use the Outlook app UI, which is a pain to do.
Alternatively, you should save the screenshot as an actual file, instead of having it in the clipboard. Depending on how you capture the screenshot, there are several ways of doing that.
But when you have it as a file, you can then use Convert file to base64 to convert it to an encoded string. And then you can embed that into the email body like this:
<img src="data:image/png;base64,{yourBase64String}" alt="SomeImage" />
Where you should replace {yourBase64String} with the base64 string.
See here for reference: https://learn.microsoft.com/en-us/power-automate/desktop-flows/how-to/add-images-email-messages
-------------------------------------------------------------------------
If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.
I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.
WarrenBelz
146,743
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,079
Most Valuable Professional