Skip to main content

Notifications

Community site session details

Community site session details

Session Id : B7oGPLHyJb/7d0mUliEzlt
Power Apps - Building Power Apps
Unanswered

Upload a file to teams folder.

Like (1) ShareShare
ReportReport
Posted on 8 Aug 2023 15:52:25 by 19

I am currently building a power app to upload receipts for a company credit card into a teams folder. Here are my wishes for the app

1. Each employee has their own folder - is there a way to choose which folder the attachment goes to? 

2. I have figured out the patch function for everything BUT the attachment. 

3. I also wrote a power automate function that WILL do everything I need, including renaming the file into the correct format. 

4. I am not sure if there's a way to use the power automate function with the data from the fields in the app. 

 

Here's what I have so far: 

mdchris_0-1691509784281.png

 

With the patch function on the button

Patch(PCardFolder, Defaults(PCardFolder)

 

{   Title:"Default",

    Employee_Name:EmNameInput.Text,

    Vendor:VendorNameInput.Text,

    Purchase_Date:Value(DatePicker1.SelectedDate),

    Purchase_Amount:Value(PurchaseAmountInput.Text),

    Attachment:Value(FileAttachment.updates)

    }

);

 

PcardFolder.run

 

Reset(EmNameInput);

Reset(VendorNameInput);

Reset(PurchaseAmountInput);

Reset(DatePicker1);

Reset(FileAttachment);

Navigate(Confirm)

 

and here's what I have for the power automate. 

mdchris_1-1691509872586.png

 

I know I am close - I just need to make it work together. 

 

Categories:
  • mdchris Profile Picture
    19 on 14 Aug 2023 at 18:29:26
    Re: Upload a file to teams folder.

    Still having issues if anyone can help

  • mdchris Profile Picture
    19 on 08 Aug 2023 at 19:08:57
    Re: Upload a file to teams folder.

    Have adjusted to the following code: 

    Patch('PCard List', Defaults('PCard List'))
    { Title:"Default",
    Employee_Name:EmNameInput.Text,
    Vendor:VendorNameInput.Text,
    Purchase_Date:Value(DatePicker1.SelectedDate),
    Purchase_Amount:Value(PurchaseAmountInput.Text),
    Attachment:Value(FileAttachment.updates)
    }
    ;
    PcardFlow.Run(
    EmNameInput.Text,
    VendorNameInput.Text,
    Value(DatePicker1.SelectedDate),
    Value(PurchaseAmountInput.Text),
    FileAttachmentDataCard.Attachments)
    ;
    Reset(EmNameInput);
    Reset(VendorNameInput);
    Reset(PurchaseAmountInput);
    Reset(DatePicker1);
    Reset(FileAttachment);
    Navigate(Confirm)

     

    Getting the error "Unexpected Characters:

  • poweractivate Profile Picture
    11,078 Most Valuable Professional on 08 Aug 2023 at 16:04:40
    Re: Upload a file to teams folder.

    @mdchris 

    i assume its just a typo in the post, but PcardFolder.run is not correct, Run must be capitalized, and arguments should be passed into Run matching parameters declared in the Flow.

    So in case that's what you actually have, change it to something like below.

     

    PcardFlow.Run(
     EmNameInput.Text,
     VendorNameInput.Text,
     Value(DatePicker1.SelectedDate),
     Value(PurchaseAmountInput.Text),
     FileAttachmentDataCard.Attachments // you may need to change this to something else
    )
    
    //replace the above example with working values

     If PCardFolder is the name of your Flow, it should not have Patch used, and if PCardFolder is not the name of your Flow, it should not have Run called on it, something like name of the Flow (suppose PcardFlow for example) should be what has Run called on it.

     

    See if it helps @mdchris 

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
MS.Ragavendar Profile Picture

MS.Ragavendar 32

#2
Rajkumar_M Profile Picture

Rajkumar_M 16 Super User 2025 Season 1

#2
mmbr1606 Profile Picture

mmbr1606 16 Super User 2025 Season 1

Overall leaderboard
Loading started