cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
zollingerc
Frequent Visitor

Retrieve an attachment from a form owned by a group

Hi all! I've attempted searching but I'm not seeing this exact problem, so apologies if I missed it. 

 

I have a form that's owned by our Advancement group and it allows for a picture to be submitted as an attachment. Upon submission, I create a SharePoint list item with the responses, then check to see if an attachment was submitted. If there is no attachment, I send an email that contains the information. If there IS an attachment, I do a Parse JSON, then Get file content, then Add attachment to attach the file to the SP list item I created previously, then send the email with a link to the SP list attachment.

 

I've done this successfully with forms I owned, where I'm retrieving the file from my own OneDrive. Where I'm running into trouble now is that I can't seem to retrieve the file from the team site of the Advancement group. 

 

My connections are in place using a service account, and the service account has read/write access to the Advancement team site. I've verified that the files show up in that location. 

 

So ... is there a way I can indicate a specific directory, but include a variable from the JSON step to identify the correct file? Or another way to do this? 

 

Here come screenshots. 🙂 Let me know if more are needed.

 

zollingerc_0-1670015120992.pngzollingerc_1-1670015172306.pngzollingerc_2-1670015183869.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

Yes, it can be done.  The link property provided by the Parse JSON has what you need, but youhave to do two things to it.

1) Its the Full Path to the file including the Site address so you have to take the Site Address off the front using a SubString() function.  My Site address is 55 characters long.

2) Put the result inside an EncodeUriComponent() function to create the file identifier.

image.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

3 REPLIES 3
zollingerc
Frequent Visitor

One note: I did consider just rebuilding the form with the service account as owner. I'll do that if I need to, but I'd prefer to understand how to retrieve from a team site if what I'm attempting is possible.

Yes, it can be done.  The link property provided by the Parse JSON has what you need, but youhave to do two things to it.

1) Its the Full Path to the file including the Site address so you have to take the Site Address off the front using a SubString() function.  My Site address is 55 characters long.

2) Put the result inside an EncodeUriComponent() function to create the file identifier.

image.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
zollingerc
Frequent Visitor

Worked like a dream! Thank you so much, Paul.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (7,164)