cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rkgoriparthi
New Member

PowerApps Attachment Control Uploaded File Size Validation

We are using the Power Apps Attachments control to upload files like word documents, excel sheets etc. By using PowerApps without Flow How to validate the uploaded file size is greater than 0 KB or not? if the file size is 0 KB then display error message to the users.

 

3 REPLIES 3
v-xiaochen-msft
Community Support
Community Support

Hi @rkgoriparthi ,

 

The file size can only be judged after the user uploads it.

If the file size is 0KB, delete the file, otherwise keep it.

 

I assume you save the attachments to the attachment column in list.

I did a test for you.

 

1\ This is my flow 'Test50'.

v-xiaochen-msft_1-1619762238990.png

Id: Ask in powerapps

v-xiaochen-msft_3-1619762342217.png

Value:div(int(length(string(outputs('Get_attachment_content')?['body']))),1024)

v-xiaochen-msft_4-1619762399326.png
 
2\ Set the submit icon Onselect property to:
SubmitForm(your form);Set(A,Test50.Run(your form.LastSubmit.ID,your form.LastSubmit.ID).thevar3)
 
3\ Add a label control and set its Text property to:
A
v-xiaochen-msft_7-1619763010139.png

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

How to validate the uploaded file size is greater than 0 KB or not? if the file size is 0 KB then display error message to the users by using only PowerApps without Flow?

v-xiaochen-msft
Community Support
Community Support

Hi @rkgoriparthi ,

 

This is impossible. Just using powerapps can't meet your requirements.

 

Best Regards,

Wearsky

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,402)