cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PMac
Helper II
Helper II

Get file content not working

I have a flow that has been going for several months.  It is triggered by a form, and if that form has an attachment the attachment is added to an output email.  Just after Christmas it stopped working and all attempts to fix it have failed.

 

I think there is a bug with the actual action but I'm not sure how to proceed.  

1 ACCEPTED SOLUTION

Accepted Solutions
v-yiwenxie-msft
Microsoft
Microsoft

Hi @PMac 

 

If the form has an attachment, then the attachment will be automatically stored in OneDrive as a file.

 

If you want the attachment being added to an output email, you need to get the file in OneDrive by checking whether the attachment ID in ‘Response details’ is equal to the ID of OneDrive file.

 

The whole flow is as below:

1.19-1.PNG

 

For the ‘compose 2’ action:

You can peek the code of dynamic content for the question which may have attachment in an compose action:

1.19-2.PNG

 

1.19-3.PNG

 

1.19-4.PNG

 

For the ‘Apply to each’ action:

1.19-5.PNG1.19-6.PNG

 

Best Regards,
Community Support Team _ Kira Xie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-yiwenxie-msft
Microsoft
Microsoft

Hi @PMac 

 

If the form has an attachment, then the attachment will be automatically stored in OneDrive as a file.

 

If you want the attachment being added to an output email, you need to get the file in OneDrive by checking whether the attachment ID in ‘Response details’ is equal to the ID of OneDrive file.

 

The whole flow is as below:

1.19-1.PNG

 

For the ‘compose 2’ action:

You can peek the code of dynamic content for the question which may have attachment in an compose action:

1.19-2.PNG

 

1.19-3.PNG

 

1.19-4.PNG

 

For the ‘Apply to each’ action:

1.19-5.PNG1.19-6.PNG

 

Best Regards,
Community Support Team _ Kira Xie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thank you.  This is slightly different than the flow I had in place (which used Parse Json).  I will give the above a go and report back.

@v-yiwenxie-msft I've been working on this but have got stuck.  My flow is a little different from yours as it requires updating a SharePoint list, and the document itself is housed in SharePoint (as opposed to One Drive).

I've followed all the steps but the Compose 2 / Json is creating an error.  I'm receiving a message:

Unable to process template language expressions in action 'Compose2' inputs at line '1' and column '27233': 'The template language function 'json' expects its parameter to be a string or an XML. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#json for usage details.'.

The below is a copy of the expression I'm using, and I can't figure out where the string/XML relates back to.  Can you provide some direction?  I'm learning as I'm going along but am still fairly new to the coding side of automate.

json(outputs('compose')?['rcf459b31ef344c4d96020c4a5d603166'])

Here are screenshots of this part of the flow for full reference.  The first part gets the data, has some initialise and setup variables to concatenate multiple responses, and creates a item in a SharePoint:

Attachment Flow 1.PNGAttachment Flow 2.PNG

v-yiwenxie-msft
Microsoft
Microsoft

Hi @PMac 

 

The function you use has no problem.

Just add an condition as below:

1.19-13.PNG

empty(outputs('compose')?['r1dc7ffc56c1648f39f01ba4e0299a7bd'])

 

The other steps after the condition should be dragged to the 'If yes' and remains the same.

 

If your flow still has problem, please feel free to let me know.

 

Best Regards,
Community Support Team _ Kira Xie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

@v-yiwenxie-msft I am so sorry it's taken so long to respond to this.  Other priorities etc.  I'm now looking at this again and I've got it to work with SharePoint (without needing the last response you sent - but thank you), however it is generating an email for every attachment that is in the app folder and I can't figure out what would be the key to just having the relevant attachment to the email.

Also, is there a way of having multiple attachments?  Sorry to be so needy.

Thank you for all your help on this.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (1,358)