cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tbomar
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?

Thx

 

Here are screenshots:

 

tbomar_0-1652391725403.png

 

Here is code for SAVE ATTACHMENT button

tbomar_1-1652391782648.png

 

9 REPLIES 9
EddieE
Super User
Super User

@tbomar 

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.

 

tbomar
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.

@EddieE 

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

hmm...

@tbomar 

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

tbomar
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

@tbomar 

Ok.

 

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

yourFlow.Run(...)

 

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?

 

tbomar
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)

 

https://www.youtube.com/watch?v=7UeRzfPo8RE

 

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

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT 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)