Forum Discussion
Reference "File" from "For a selected Item" in SharePoint
Hi Leonel GUZMAN please refer the image and the steps below
- For a selected item you will be able to receive only few information, so you have to use some additional action to retrieve the attachment and then to save it to the new list.
- Get attachments action with the ID from the trigger action will get all the attachments of the selected list item
- The third action is to create a new item in the list b with the details you have, if you need additional list item metadata, you have to use Get Item with the ID from the trigger action.
- You have to loop through the attachments and inside the loop you have to use
- Get attachment content by passing the ID and File Identifier from the loop item
- Add Attachment by passing the Create Item action ID of the new item and then the content from the above action.
Please try it out and let me know if you have any clarifications.
- Leonel GUZMANJan 31, 2022Brass Contributor
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.
- alirananavitascomSep 21, 2022Copper Contributor
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.