cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
paulinuk
Post Patron
Post Patron

Attachments dont save to Sharepoint

Hello

 

I have a simple attachments control within a form for an existing item in a sharepoint list

 

I add a photo using the control and save using Form.Updates

 

Nothing is saved

 

In true powerapps style, no error messages, nothing, just doesnt work!

 

Has anyone had this?  This should be such a simple thing to do!

 

Paul

9 REPLIES 9
RandyHayes
Super User
Super User

@paulinuk 

You should be using the SubmitForm function on your form instead of the Updates to get what you want.

 

Try that first to make sure it is working properly.  If you are not using that function, then you will be missing any opportunity to catch any errors.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
paulinuk
Post Patron
Post Patron

ok so when I use SubmitForm there are no errors and the attachments save but they give the appearance of not being saved because the control says unsaved

 

How can this be fixed?

 

Also, is there a way to customize the filename?  If a photo is uploaded from a device it has a GUID as the filename which is obviously not user friendly at all

RandyHayes
Super User
Super User

@paulinuk 

The Unsaved property of the form is ONLY based on an indifference between the Default and the Update property of each datacard.  If you have modified the Default or Update properties, then that would be the first place to look as to why your form would show as unsaved.  Those two properties should always produce the same results if there is no change in the record.

 

As for the file name...that is going to be based on the name as it is added to your attachment control from the file system.  There is no way to alter that except by the name itself in the file system.

 

If you need anything beyond that, you will need to employ PowerAutomate to alter the attachments and/or names.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi

 

I mean it shows unsaved against the attachment line

 

Its pretty restricted not being able to change the name

 

Even if I employ power automate how would I get the updated name to display in the control after PowerAutomate has changed it?

 

Paul

RandyHayes
Super User
Super User

@paulinuk 

Ah, the "unsaved" on the attachment control...

 

Once the form has submitted, that will go away.  If it is not going away, then something is not going right with the submit.

 

What kind of changes have you made to the form to deviate from the default?  The form itself, by default, should work perfectly fine.  So, if there is something not happening, it is most likely due to some change made.

 

There is no way to really alter the name in the attachment control except by altering the file name when attached.  This is one reason why a separate list for attachments (a document library) is always preferred for better ability to manipulate files...but that is a pretty significant change to the app and perhaps it is not something you need - but it is an option!

 

If you use PowerAutomate to manipulate the name, your form would not immediately show any changes.  That would happen only after the flow had completed and the user would go to edit the record again.  At that point, the file name would have changed.

 

I am not entirely sure of your design goals, so it is hard to state what a good approach might be in your case.  But the above provides some options for consideration.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi

 

I think I will look at a document library 

 

Ideally I want to be able to list the attachments and have a view icon is that possible?

 

I’m not doing anything non standard in the form being submitted and there are no errors which doesn’t give much to go on!

RandyHayes
Super User
Super User

@paulinuk 

Yes, sometimes the form will submit with no errors because the issue is really happening at the list level instead and the app doesn't show it.  The only real way to check that is to use the Monitor Tool to view the request and response given when the SubmitForm occurs.

 

Yes, my personal preference is the doc library.  The only downside to it is that you cannot create a new record in the library without the use of PowerAutomate, but once it is there, you can edit as needed (except for the actual file)

Attachments themselves are just not that flexible in SharePoint let alone in PowerApps.  So if you need more control, then the alternatives are better.

 

As for the question though about viewing the attachments...yes, you can certainly view the attachments in your app.  Each will have a Thumbnail property and three different sizes to choose from.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

I’m happy to use power automate

 

How would I display the attachments? Are they via  a gallery?

RandyHayes
Super User
Super User

@paulinuk 

Yes, you can use a gallery to show them.  You would just set the Items property to the Attachments property of the record you have and then in the gallery have an image which shows the Thumbnail property and the size you want.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,399)