web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / TROUBLE WITH POWER APP...
Power Apps
Suggested Answer

TROUBLE WITH POWER APPS FLOW - HEEEEELP¡¡¡

(1) ShareShare
ReportReport
Posted on by 2
Hi, sorry ,english is not my first language.
I need to developed a flow as part of a proyect, which allows me to upload files by creating a new folder for each new form A submitted, and gives back:
- A new element A of  a list
- A new folder (with it's attachments) in a document library
- The link of the folder as part of the element A of the list
 
The actual flow creates the folder and it's attachments but I can't submit the form or give the link back.
 
The code for my button is as follows:
 
ForAll(DataCardValue10_3.Attachments;'PowerAppV2->Crearnuevacarpeta'.Run(DataCardValue6_1.Text;ThisRecord.Name;
{name:ThisRecord.Name;contentBytes:ThisRecord.Value}))
 
In Attachments of this question is the image of the power apps flow I developed.
 
Please help¡¡¡¡¡¡
Flow.png
I have the same question (0)
  • Suggested answer
    frago Profile Picture
    226 on at

    Right now your issue is that you’re calling the flow inside ForAll, so it runs once per file. That breaks the response and your form submission
    You should call the flow only once and pass all attachments together. Use something like this:

    Set(
        varResponse,
        'PowerAppV2->Crearnuevacarpeta'.Run(
            DataCardValue6_1.Text,
            DataCardValue10_3.Attachments
        )
    );
    
    SubmitForm(FormA);

    Then fix the flow:


    • In Power Apps (V2) trigger, make the file input allow multiple files

    • Use Apply to each to create files in the folder

    • At the end, return the folder link with Respond to a Power App or flow




    •  
    •  
    •  

    That’s it — one call, flow does everything, and returns one link.

     
     
     
    ------------------------------------------------------------
    If this solved your issue, please mark it as ✅ Accepted Answer.
    If it helped, feel free to give it a 🩷 Like!
     
    Best regards,
    Piotr
     
     
  • Suggested answer
    WarrenBelz Profile Picture
    155,074 Most Valuable Professional on at
    If you are patching multiple attachments here, you need the structure below, however if so, you cannot set a Variable inside a ForAll. It would be possible to do a Collection of multiple returned values, but I don't think that is what you are doing.
    ForAll(
       DataCardValue10_3.Attachments As _Attach;
       Collect(
          colFiles;
          'PowerAppV2->Crearnuevacarpeta'.Run(
             DataCardValue6_1.Text;
             _Attach.Name;
             {
                file:
                {
                   name: _Attach.Name;
                   contentBytes: _Attach.Value
                }
             }
          ).file
       )
    )
    If only one attachment  - which I suspect is correct
    UpdateContext(
       {
          varFile:
          'PowerAppV2->Crearnuevacarpeta'.Run(
             DataCardValue6_1.Text;
             First(DataCardValue10_3.Attachments).Name;
             {
                file:
                {
                   name: _First(DataCardValue10_3.Attachments).Name;
                   contentBytes: First(DataCardValue10_3.Attachments).Value
                }
             }
          ).file
       }
    )
    
    then use varFile for whatever you want to after that
     
    or a simpler version
    With(
       {_Attach: First(DataCardValue10_3.Attachments)};
       UpdateContext(
          {
             varFile:
             'PowerAppV2->Crearnuevacarpeta'.Run(
                DataCardValue6_1.Text;
          _     _Attach.Name;
                {
                   file:
                   {
                      name: _Attach.Name;
                      contentBytes: _Attach.Value
                   }
                }
             ).file
          }
       )
    )
    
    Also it is good to set the MaxAttachments of the attachment control to 1 for a single file requirement. You also might consider using another name for the returned value in the Flow other then file (which is could conflict)
     
    Please Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like
    Visit my blog
    Practical Power Apps    LinkedIn  
  • WarrenBelz Profile Picture
    155,074 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for. Happy to assist further if not.
     
    Please Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn   

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 522

#2
WarrenBelz Profile Picture

WarrenBelz 437 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 405

Last 30 days Overall leaderboard