Showing results for 
Search instead for 
Did you mean: 
Helper II
Helper II

PowerApps - Issues Clearing/Resetting Variable After Submitting Form

Hi - having issues clearing and/or resetting a variable file link after submitting in PowerApps. 


I need the link to clear after submission, so the next user doesn't have a previous file link associated with their request.


Furthermore, I have a reset function on my form submit button as well. 


Any ideas what I'm missing to accomplish not having previous file link attachment show up on new requests?



Here are screenshots:




Here is code for SAVE ATTACHMENT button



Super User
Super User


Try on the end of your code snippet:

Set(varFileLink, Blank());


Also, Resetting a form won't clear a variable, even if it's used by that form. They are two separate entities.


Helper II
Helper II

@EddieE I haven't had chance yet to retry and test. Will report back soon. Thanks in advanced for help though.


Didn't work, I just submitted a new req and it still has previous attachment from old request.



What is the purpose of varFileLink variable? Seems you need it after the Flow runs meaning it needs to still be the previous Run?

Helper II
Helper II

I followed Shane Young video..


I don’t fully understand why LAST(attachment) or VarFileLink needed.


It’s a struggle attaching a file in PowerApp and saving it, etc.


open to other options




Firstly, Last() is used on the Attachment Control because that control can hold 1-many items meaning it's a table of records. So, when referencing a table you need to also reference the record inside that table you want. Shane uses Last() but you could also use First(), it doesn't matter.


VarFileLink, in this context, is used to open the last saved file. If you don't need this functionality then you can remove it, so instead of

Set( VarFileLink, yourFlow.Run(...).sharepointfilelink)

- you just need



I'm not sure what you mean by It’s a struggle attaching a file in PowerApp and saving it, etc. but there are many options available to upload / save files via powerapps. Shane's video explains a single file upload but via Google you'd be able to find multi file uploads and other methods that may suit your needs?


Helper II
Helper II

I’ll give your suggestion a try.


let’s just say my recent Google searches & attempts to find a solution have failed, lol, as I need to attach it in an approval flow that is separate from the save attachment button. Shane example actually worked for me outside of the clearing attachment.


thanks for your support.

Uploading multiple files (Shane Young again)


EDIT: I think you can only use files up to 50MB in size and it may also fail if the TOTAL upload size (eg File1 + File 2 + File3 > 50MB) is greater than 50MB - you'd just need to experiment with that


Helpful resources

Ignite 2022


Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (2,309)