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
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.
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
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.
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
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.
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!
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.
I’m happy to use power automate
How would I display the attachments? Are they via a gallery?
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.
User | Count |
---|---|
260 | |
109 | |
93 | |
57 | |
41 |