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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Attachment file duplic...
Power Apps
Answered

Attachment file duplicates when submitting vis Powerapps with Dataverse backend

(0) ShareShare
ReportReport
Posted on by 24

HI All,

 

I have a canvas PowerApps with Dataverse as backend. I attached a file and added data in Canvas Powerapps and submitted. The data and Attachement got successfully submitted to Table in Dataverse. But when i again retrieved the submitted record via Gallery in Powerapps and updated data and resubmitted,the data updates was successfully submitted. But when i retrieve the record in Powerapps gallery, i  find that attached file submitted in the first instance has duplicated. Can you please let me know if there is any settings that i need to change such that attached file does not get duplicated whenever i re-submit the same record.

 

Thanks for your help!

Shashank

Categories:
I have the same question (0)
  • v-xiaochen-msft Profile Picture
    on at

    Hi @shettyshashank1 ,

     

    Could you tell me:

    Are other attachments automatically added when the record is modified?

     

    If so ,this is a strange problem.

     

    I did not encounter similar problem. Please see the picture below.

    1\ Insert a label control into gallery control and set its Text property to:

    CountRows( ThisItem.Attachments)

     

    2\ This is my record before modification. Now it has an attachment.

    v-xiaochen-msft_0-1613357447069.png

    3\ Select the record and modify its 'Name' column and save it.

    v-xiaochen-msft_1-1613357473943.png

    v-xiaochen-msft_2-1613357558280.png

     

    4\ The result is as follows:

    v-xiaochen-msft_3-1613357581791.png

    v-xiaochen-msft_4-1613357593197.png

     

    If you have any problems, please provide specific formulas.

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

     

     

     

  • shettyshashank1 Profile Picture
    24 on at

    Apologies for my delayed response and appreciate your reply. I may have not phrased my issue correctly. 

    The attachments are showing to be duplicated only in display mode but not in edit mode.

    Please refer below with exact steps leading to my issue with screenshots as below:-

    1) I create a new form and add attachment (Pic5.jpg) and submit it.  Please refer attached screenshot1 file before submitting the form.

    2) The form gets submitted successfully. When I click on the submitted form in gallery and view it in display mode. I can view the file attached. I edit the form and update a field and again submit without attaching any new file. The form gets submitted again successfully.

    3) when I again go to gallery and click on submitted form to view the form in display mode, I can see two same file names as per attached screenshot2 file.

    4) But when I go into edit mode, I can only see one file.

     

    So this issue of duplication of files only happens in display mode. Please let me know if you want me to try anything to resolve this issue.

     

    thanks

  • v-xiaochen-msft Profile Picture
    on at

    Hi @shettyshashank1 ,

     

    This is a strange problem.

     

    Could you tell me:

    If you can see two attachments in the view display mode, how many attachments do you actually have?(one or two?)

    Could you provide specific formulas?

     

    Best Regards,
    Wearsky

     

  • shettyshashank1 Profile Picture
    24 on at

    HI @v-xiaochen-msft ,

     

    I only have one attachment. I am just using the default attachment option of dataverse. i haven't edited or modified any formulas related to attachment.  The formula for attachment in displaymode is just Parent.Default.

     

    thanks

    Shashank

  • v-xiaochen-msft Profile Picture
    on at

    Hi @shettyshashank1 ,

     

    You could try this formula on your attachment data card' s Default property of display form control.

    First(ThisItem.Attachments)

    v-xiaochen-msft_0-1614059113459.png

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

     

     

  • shettyshashank1 Profile Picture
    24 on at

    HI @v-xiaochen-msft ,

    The above will only help if i attach only 1 file as attachment initially.

     

    But if i attach two different files initially while submitting and in display , i can view 4 files in display mode which is  2 each of each file.  I should be able to view both files.  If i go with First(ThisItem.Attachments), then i can only view only one file. Please refer for below example

     

     

    1) I attach file1.jpg and file2.jpg initially while submitting. 

     

    2) After submission, when i retrieve the the item, i can view file1.jpg and file2.jpg in display mode which is as expected.

     

    3) I modify a field and submit the form again. When i again retrieve the item in display mode, i actually view 4 files now which are file1.jpg, file1.jpg, file2.jpg, file2.jpg

     

    4) if i change the formula to First(ThisItem.Attachments), i can only view file1.jpg in display mode. 

    I should be able to see file1.jpg and file2.jpg which is not happening at the moment.

     

    Please let me know if you want me to try anything else.

     

    thanks

    Shashank

     

  • Verified answer
    v-xiaochen-msft Profile Picture
    on at

    Hi @shettyshashank1 ,

     

    You could try this formula on your attachment data card' s Default property of display form control.

    ForAll(Distinct(ThisItem.Attachments,DisplayName),LookUp(ThisItem.Attachments,DisplayName=Result))

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

  • shettyshashank1 Profile Picture
    24 on at

    Thanks @v-xiaochen-msft , It Worked. Thanks for your help !

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard