Forum Discussion
Reference "File" from "For a selected Item" in SharePoint
Thank you very much Sudharsan K
The challenge I have is that List A doesn't have the attachment I need in List B. The only thing I get from List A is the ID, so that I can relate items in List B (Primary and Foreign Keys).
In the "For a selected Item" action, I ask the user to give me new information: an Update (text), and an attachment (file).
I then create variables to use a) the text I get for the update, and b) the ID from List A, that I also use as a reference in List B. I haven't been able to use the input I get for file (Attachment (optional)).
If I understand the use of "Get attachments" correctly, that action helps me get attachments from a list. However, I'm not trying to use attachments from the list, but the brand new file the user gives me through "For a selected item". This is the screen the user gets to provide the new input. The file in that new input is the challenge. I haven't understood how to use it and save it in List B.
Thank you for your help.
Leonel GUZMAN did you get an answer, I have exact same issue.
- kgordisJul 26, 2025Copper Contributor
alirananavitascom Solution posted below where using a Compose action to name the file does the trick. Wasted 4 hours trying to figure out a solution. So glad post below worked.
- Leonel GUZMANSep 21, 2022Brass Contributor
- alirananavitascomSep 26, 2022Copper Contributor
Leonel GUZMAN sorry to hear you had to drop the project.
Not a good omen for me thinking of having Microsoft being able to actually solve any issue that their end users face. Its just so draining working on Microsoft products!!
- VArik966Dec 20, 2022Brass Contributor
alirananavitascom, @Leonel GUZMAN,
Please find below the solution I tried :
I was not able to recover the filename with the flow, so I used this expression to get it from the attachement I uploaded manually :
string(triggerbody()?['file']?['name'])
It allows me to get the filename and store it in my SharePoint list.
Please let me know if it's ok for you.