cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AK-47
Helper I
Helper I

Get file content from previous step

Hi, I am trying to get the content of the file in the previous step but no matter which approach I take the flow errors at this point. What is the correct way to read in the file content from the previous step without statically using a filename. This flow operates on a number of file names so I need it to remain dynamic.

 

AK-47_1-1618379356746.png

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

Hi @AK-47,

 

You could also try the Get file content by path action to approach that, for example:

Screenshot 2021-04-14 161944.jpg

 Best Regards,
Community Support Team _ Lin Tu

View solution in original post

9 REPLIES 9
fchopo
Super User II
Super User II

Hi @AK-47 

As I understand by your screenshot, you are creating files in SharePoint based on email attachments. So you could get the file content from the attachments, and not from the SharePoint item. Apart from that, you're copying a file from one SharePoint site to another, but this could be done by creating the same file in two different sites. Am I right?

Regards,

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!
CFernandes
Super User III
Super User III

Hey @AK-47 

 

You can use the "Id" output of the Create file action in the "Get File Content".

 

Please make sure you select the same site address in the Get File Content action that you have used in the Create file.

 

CFernandes_0-1618384092564.png

 

I did a test and it worked for me. 

 

CFernandes_1-1618384176085.png

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

 

Not quite. File attachment from email is save to a Sharepoint library. I am trying to write out the .txt as a .csv in the same location.

AK-47
Helper I
Helper I

Thanks for the reply. I did try that but it error'd. Let me try again and come back to you.

fchopo
Super User II
Super User II

Could you explain in more detail which is the idea of the flow? I mean, you receive some txt files in an email, and want to save them in a SharePoint library with 2 different extensions (txt and csv)? Am I right?

Regards,

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!
v-litu-msft
Community Support
Community Support

Hi @AK-47,

 

You could also try the Get file content by path action to approach that, for example:

Screenshot 2021-04-14 161944.jpg

 Best Regards,
Community Support Team _ Lin Tu

View solution in original post

AK-47
Helper I
Helper I

Lots of great suggestions and questions so let me go a bit further on this.

 

That's correct. The saving of the txt attachment is fine. I am trying to extend that process now to rename the file. The rename option is limited to a boolean which is correctly set but it won't take file extension parameters. What I have determined is that I need to continue to save the attachment as .txt then read in the file content to copy out to a new file name with the .csv extension. The flow fires on multiple emails, with differently named attachments. Therefore the flow needs to be able to use the ID of from the previous step.

 

When using the Id the error is:

The destination path cannot be the same as the source object itself.

 

When using the Path it errors saying path not found even though the debug output is pointing to it.

 

flow.jpg

muralidharan
Helper I
Helper I

Hi @AK-47 ,

I believe you're trying to use variables and use them in the subsequent steps. 

 

muralidharan_0-1618392241350.png

 

Regards,

Murali!

 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. !

 

 

 

AK-47
Helper I
Helper I

Thanks for everyone's help. I worked it out. I was overcomplicating it. Marking  answer as correct since it was the correct part that was missing/wrong once I removed the junk out it.

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (69,512)