web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Saving Attachment Fiel...
Power Apps
Answered

Saving Attachment Field Values to a Local Collection

(0) ShareShare
ReportReport
Posted on by 75

Hi,
I'm building an app where user can add deviations to a sharepointlist, I'm using an editform to allow the users to add an attachment to the item they create.

However, the app is supposed to support offline capabilities, and here is my problem:
If the connection is lost during the creation of a new deviation I want to save all the data from the from, this is fine for most inputs as it collects the text/selected values from each of the datacards and saves them to a collection. 

For other purposes in the app I want to save the attachments in a separate collection with the following columns:
| LocalID | Name | Image |

My though was to use For All as followed:
ForAll(AttachmentDataCardValue.Attachments, Collect(newCollection, { LocalID: newID, Name: Name, Image: Value }));

This gives the error 'Name isn't valid. This identifier isn't recognized'.

When I tested It worked fine for the name only when using this formula:
ForAll(AttachmentDataCardValue.Attachments.Name, Collect(newCollection, {LocalID: newID, Name: Name}));

So I my question is then, how can I collect both the names and values of the attachment field?
Any help or ideas is highly appreciated.

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    156,100 Most Valuable Professional on at

    Hi @TommySandtorv ,

    A different approach, but do you want all the attachments on an attachment control in a collection with fields Name, Value (as per the attachment) and a Field called LocalID with all same value which you specify as newID (I assume a Variable)? Try this

    ClearCollect(
     colTemp,
     AttachmentDataCardValue.Attachments
    );
    ClearCollect(
     colNew, //or whatever you want to call it
     AddColumns(
     colTemp,
     "LocalID",
     newID
     )
    );
    Clear(colTemp)

     

    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.

     

  • TommySandtorv Profile Picture
    75 on at

    Thanks @WarrenBelz,

    This works fine, just had to change the collection to have the image saved in a column named value throughout the app in order to use the already existing collection.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard