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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to remove upload f...
Power Apps
Unanswered

How to remove upload file after file not csv

(0) ShareShare
ReportReport
Posted on by 267

HI 

 

   I use "form" to upload file to my sharepoint list , and I want to limit "only csv file can upload " if user still upload some files not csv then system will show notify message and "delete the file auto"

 

JACK_LAI_1117_0-1625493108823.png

 

In "Onaddfile" I use this formula ....so it can show notify message , but after one hour later I still can not find any method to remove the file "auto" ........so how should I use formula in "onaddfile" function ???

 

JACK_LAI_1117_1-1625493298611.png

 

 

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    153,042 Most Valuable Professional on at

    Hi @JACK_LAI_1117 ,

    Put this on the OnAddFile

    If(
     Right(
     Last(Self.Attachments).Name,
     3
     ) <> "csv",
     Notify(
     "Only CSV Files Allowed",
     Error
     );
     Reset(Self)
    )

     The file will be deleted immediately and the user will get the message.

     

    Please click Accept as solution 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 giving it Thumbs Up.

  • JACK_LAI_1117 Profile Picture
    267 on at

    @WarrenBelz 

        Thank you for your replay .

        But if user upload first file is csv but second file is docx , then will clear all uploaded files , so user need to re-upload files .

        So , could I only remove the file that not csv format !!!

     

      

  • JACK_LAI_1117 Profile Picture
    267 on at

    HI ALL,

        I found other method to do it !!!

        in "onaddfile" formula is 

    If(
    Last(
    Split(
    Last(
    Self.Attachments).Name,
    ".")
    )
    .Result <> "csv",
    Notify(
    "File must be csv format !!!!"
    );

    )

    JACK_LAI_1117_1-1625533669479.png

     

    And in the submit button  , the formula like this .....so even user upload wrong format file ,they still not upload file to my sharepoint list , and they need manual remove the wrong format file .

     

    ForAll(
    DataCardValue2.Attachments,
    If(
    Last(
    Split(
    Name,
    "."
    )
    ).Result <> "csv",
    Notify("Some files are not csv format , please check it ",NotificationType.Error),
    Notify("BBB")
    )
    )

    JACK_LAI_1117_2-1625533764175.png

     

    the result page like this 

    JACK_LAI_1117_3-1625533926203.png

     

     

     

  • WarrenBelz Profile Picture
    153,042 Most Valuable Professional on at

    @JACK_LAI_1117 ,

    Surely a user would only do that once before learning that the file has to be CSV. My users certainly would learn very quickly (hence the solution I provided)

  • JACK_LAI_1117 Profile Picture
    267 on at

    @WarrenBelz 

     

    Got it , I will "training " our user to know it.

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard