Expression
first(outputs('Get_response_details')?['body/<YourUploadQuestionId>'])
Notes
Use the real upload question id from your form, not <ImageQuestionID>.
When you run once, FileObject output should be a JSON object with link, name, id, etc.
Step 2. Build a clean SharePoint file path from the link
Add a Compose action named SPFilePath.
Expression
concat(
'/',
first(
split(
last(split(outputs('FileObject')?['link'], '/sites/KennedysTestTeam/')),
'?'
)
)
)
Why this matters
The split on “?” strips querystring tokens, which otherwise cause “Invalid request”.
Step 3. Switch to SharePoint “Get file content using path” from Onedrive
Replace your current OneDrive for Business action with SharePoint.
Action
SharePoint, Get file content using path
Site Address
https://ABCD.sharepoint.com/sites/KennedysTestTeam
File Path
outputs('SPFilePath')
This returns the raw bytes reliably for Microsoft Forms file uploads stored in that site.
Step 4. Post to Teams in a way that keeps the image visible
Teams message actions do not reliably render inline base64 images. Use one of these two patterns.
Option A (most reliable)
SharePoint, Create file (in the Team channel folder)
-
Folder Path: the channel’s Documents folder path
File Name: outputs('FileObject')?['name']
File Content: outputs from “Get file content using path”
-
Teams, Post message in a channel
Message: include the SharePoint link to the created file
Option B (attachment)
If your tenant connector supports it, use Teams “Post message in a channel (V3)” with an attachment payload using the file content. Many tenants still do not show images inline, they show as an attached file, which is fine.
Let me know how it goes, Feel free to reply or Please mark this answered if it works.