cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RodrigoCastelli
Helper IV
Helper IV

Saving Attachments to Sharepoint list working Offline

Hello everyone,

 

I've read planty content about the trouble i'm facing  and even though i couldn't solve it.

 

I have an app made from a Sharepoint List working offline that stores data locally and when the devide is connected the data is sent to the SharePoint List. But my field that sents the attachment is no working.

 

I Have a button to store data that ON SELECT runs this code:

if(Connection.Connected;SubmitForm(EditForm1);Collect(arrtemp;{tempTítulo:DataCardValue9.Text;tempObs:DataCardValue16.Text;tempAttachment:DataCardValue27.attachments;tempnovo:varNovo});;SaveData(arrtemp;"Localtemp"));;ClearCollect(arrHistóricos;Históricos);;Back()

 

Then, to send it to the server i have the code below:

 

ForAll(arrtemp;If(tempnovo = true;Patch(Históricos;{};{Título:tempTítulo;Observação:tempObs;Attachment:tempAttachment;});Patch(Históricos;LookUp(Históricos;Título=tempTítulo);{Título:tempTítulo;Observação:tempObs;Attachment:tempAttachment)));;Clear(arrtemp);;SaveData(arrtemp;"Localtemp");;ClearCollect(arrHistóricos;Históricos)

 

I don't have an idea how to solve this. if someone could help me i would appreciate.

 

Thanks,

4 ACCEPTED SOLUTIONS

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @RodrigoCastelli ,

The only way to save attachments files from the Attachment Control unfortunately is SubmitForm while online.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Hi @RodrigoCastelli ,

Here is a very good blog on this.and a bit more on this post. I am happy to help with any code you get stuck on after you have produced your model.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

Hi @RodrigoCastelli ,

I assume by Form you are referring to a standard Power Apps form?

By "inside" - you are wanting to display the photo (or Photos) belonging to that form?
I generally have a "camera" screen and file the photo in a SharePoint Library. These can be displayed in a gallery on the same screen as below

P2PhotoShow.png

I am just showing you what is possible (in a process very similar to yours) as this was your question. You have a bit of work on code in front of you. Here are a couple of good videos from Shane Young and Paul O'Flaherty.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Hi @RodrigoCastelli ,

When you choose View > Data Sources, can you see the Flow? If not, you have not connected it.

Put an button on the screen and choose Action > Power Automate, find the Flow and connect it. You can then then delete the button as you have the code already on another control.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

12 REPLIES 12
WarrenBelz
Super User
Super User

Hi @RodrigoCastelli ,

The only way to save attachments files from the Attachment Control unfortunately is SubmitForm while online.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Hello @WarrenBelz ,

 

Thanks for the reply.

 

Do you know if there is an alternative to work on this?

 

Best regards,

Hi @RodrigoCastelli ,

Other than pictures, which can be saved in a collection, but then they are generally written to a Library.

Attachments are an on-line facility only.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

@WarrenBelz,

 

The attachments i was trying to save was actually pictures taking from sites. So i think it can work.

 

I'm a noob on this. How could i make it?

 

Thnaks again!

 

Best regards,

 

 

Hi @RodrigoCastelli ,

Here is a very good blog on this.and a bit more on this post. I am happy to help with any code you get stuck on after you have produced your model.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

Hi @WarrenBelz,

 

I've read the contents you sent me.  But i still need clarify some things.

 

First, let me introduce a necessity. This app has the propose to collect data to maintenence, we have a list of equipments or places to visit and those items must to be in the app for user selection. That is easy with a forms.

 

But i also need a Picture that goes together with this data of a place/equipment that i already have in the form.

 

So the camera should be inside the form, or something like it, to send the Picture together with the form, because they are related and the examples for what i undestand, are sent images without this link.

 

Sorry if i misunderstand something, but it seens very complex for my low experience.

 

If you could help me to find a solution to this, i appreciate.

 

Thanks!

 

 

Hi @RodrigoCastelli ,

I assume by Form you are referring to a standard Power Apps form?

By "inside" - you are wanting to display the photo (or Photos) belonging to that form?
I generally have a "camera" screen and file the photo in a SharePoint Library. These can be displayed in a gallery on the same screen as below

P2PhotoShow.png

I am just showing you what is possible (in a process very similar to yours) as this was your question. You have a bit of work on code in front of you. Here are a couple of good videos from Shane Young and Paul O'Flaherty.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Hi @WarrenBelz ,

 

I tried to copy exacly the same code as MIKAEL SVENSON in the link you proposed.

 

https://www.techmikael.com/2017/05/saving-collection-of-images-from.html

 

But in Power Apps i'm struggling to understand the error on the code in my function ON SELECT that sends data to server runs:

 

ForAll(PictureColl;Collect(SubmitData; { filename: Concatenate(Text( Now(); DateTimeFormat.LongDate );Mid("0123456789ABCDEFGHIJKLMNOPQRTSUVWXYZ"; 1 + RoundDown(Rand() * 36, 0); 1);Mid("0123456789ABCDEFGHIJKLMNOPQRTSUVWXYZ"; 1 + RoundDown(Rand() * 36; 0); 1);".jpg"); filebody: Url }));;SaveImages.Run(Concat(SubmitData; filename & "|" & filebody & "#"))

 

The error presented is that this function needs an operator.

 

The only thing i have changed is the , for ; and ; for ;;, due the language difference.

 

i've attached the code proposed for information.

 

If you could help me i would really appreciate.

 

Best regards,

Hi @RodrigoCastelli ,

Can you please pull this apart and tell me where the error is. I also use a different method to this.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,193)