Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Passing Multiple Files from Power Apps to Power Automate

Posted on by 21
I have a Power App that allows the user to add to an attachments collection. The collection takes the contents of attAttachments (attachments control) and adds it to the collection after the add button is pressed using 
 
    Collect(colAttachmentsBase64,
        ForAll(attAttachments.Attachments,
        {
            Name: ThisRecord.Name,
            ContentBytes: JSON(ThisRecord.Value, JSONFormat.IncludeBinaryData),
            ItemID: pItemID
        }
    )
    );  
 
I then pass the collection to Power Automate using 
      CSUStoSharepoint.Run(JSON(colAttachmentsBase64));
 
The problem seems to be that once it gets to Power Automate, the ContentBytes text is referring to the file in the apps memory
instead of the actual file contents.I want to be able to store the files as attachments to a sharepoint list item, so I need
the actual file here. Here is the output of a compose action showing the JSON:
 
"[{"ContentBytes":"\"appres://blobmanager/64a39917bb044b6b94ec3529f5d0c9a2/3\"","ItemID":4,"Name":"6inch pretest MTRS.pdf"},
{"ContentBytes":"\"appres://blobmanager/64a39917bb044b6b94ec3529f5d0c9a2/6\"","ItemID":6,"Name":"L3101 ASBUILT REV1.pdf"},
{"ContentBytes":"\"appres://blobmanager/64a39917bb044b6b94ec3529f5d0c9a2/6\"","ItemID":7,"Name":"L3101 ASBUILT REV1.pdf"},
{"ContentBytes":"\"appres://blobmanager/64a39917bb044b6b94ec3529f5d0c9a2/7\"","ItemID":7,"Name":"MTRS_Pretest.pdf"},
{"ContentBytes":"\"appres://blobmanager/64a39917bb044b6b94ec3529f5d0c9a2/7\"","ItemID":8,"Name":"MTRS_Pretest.pdf"},
{"ContentBytes":"\"appres://blobmanager/64a39917bb044b6b94ec3529f5d0c9a2/8\"","ItemID":8,"Name":"L3101 ASBUILT REV1.pdf"},
{"ContentBytes":"appres://blobmanager/64a39917bb044b6b94ec3529f5d0c9a2/8","ItemID":9,"Name":"L3101 ASBUILT REV1.pdf"}]"
 
How can I work around this? I saw one example that used an image control in a gallery to get the actual file contents,
but in my case it could be any file type (.docx, .pdf, .jpg) etc.
 
Categories:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,246

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,884

Leaderboard