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 / How to patch only atta...
Power Apps
Answered

How to patch only attachments with form.update

(0) ShareShare
ReportReport
Posted on by 57

Hello Folks,

 

i have a form in which i have 4 different content type. i am using switch method to patch data conditionally. However i have also attachment card in which i am collecting photos captured by camera. i also want to patch these photos conditionally. i tried to use "Form1.Update" at the end of one of the switch case bur in that case all elements are updated instead of certain content type.

 

What could be the solution?

 

Here my code :

 

 

 

Switch(
 DataCardValue13.Selected.Name,
 "Vardiyalık1",
 Patch(
 'ML St110 Otonom Bakım',
 Defaults('ML St110 Otonom Bakım'),
 {
 '{ContentType}': DataCardValue13.Selected,
 Title: DataCardValue1.Text,
 'T1 Sıkma kafasının ve Baskı mili ucunun temizliği Hasar ve Aşınma kontrolleri': DataCardValue36.Value,
 'T1 Açıklama': DataCardValue10.Text,
 'K1 Greiferlerin Dayama Uçlarının Kontrolü (Kırılma/Kopma/Vuruk)': DataCardValue15.Value,
 'K1 Açıklama': DataCardValue14.Text,
 'K11 AA Tutucu Aufnahme Alt Dayamalarının boşluk toleransının kontrolü': DataCardValue16.Value,
 'K11 Açıklama': DataCardValue17.Text,
 'K8 Her tip için manometrelerden hava basıncı kontrolü': DataCardValue32.Value,
 'K8 Açıklama': DataCardValue31.Text,
 'K2 Yağ tankı basınç kontrolü': DataCardValue21.Value,
 'K2 Açıklama': DataCardValue20.Text,
 'T14 DSM yağlama, atık yağı kabının boşaltılması': DataCardValue44.Value,
 'T14 Açıklama': DataCardValue43.Text,
 'T2 H.Körper ve D.Platte Greiferlerinin Temizliği': DataCardValue46.Value,
 'T2 Açıklama': DataCardValue45.Text,
 'T3 Döner tabla üzerinin Temizliği': DataCardValue48.Value,
 'T3 Açıklama': DataCardValue47.Text,
 'T4 İstasyon tablasının Temizliği': DataCardValue49.Value,
 'T4 Neden': DataCardValue50.Text,
 'T5 Düsenmodül Aufnahmesi ve El Aparatı Aşınma Kontrolü ve Temizliği': DataCardValue52.Value,
 'T5 Açıklama': DataCardValue51.Text,
 'T6 Sızdırmazlık Aufnahmelerinin Temizliği, Hasar Kontrolü ve O-ringlerinin kontrolü': DataCardValue54.Value,
 'T6 Açıklama': DataCardValue53.Text,
 'T7 DSM Kamera lensinin temizliğ': DataCardValue56.Value,
 'T7 Açıklama': DataCardValue55.Text,
 'T9 DSM Yağlama Aufnahmesinin temizliği': DataCardValue58.Value,
 'T9 Açıklama': DataCardValue57.Text
 }
 ),
 "Günlük1",
 Patch(
 'ML St110 Otonom Bakım',
 Defaults('ML St110 Otonom Bakım'),
 {
 'Content type': DataCardValue13.Selected,
 Title: DataCardValue1.Text,
 'T10 İstasyon Koruma Kapaklarının temizliği,bağlantı civatalarının kontrolü': DataCardValue38.Value,
 'T10 Açıklama': DataCardValue37.Text,
 'T11 Düsentellerabfrage aparatının temizlik hasar ve aşınma kontrolü': DataCardValue40.Value,
 'T11 Açıklama': DataCardValue39.Text,
 'K3 Tüm Uyarı Lambalarının Fonksiyon Testi (ANA MENÜ + F8+F1+F1+F7 )': DataCardValue23.Value,
 'K3 Açıklama': DataCardValue22.Text,
 'K4 Vakum kafasının hava hortumlarının kontrolü (Kaçak, deformasyon vs.)': DataCardValue25.Value,
 'K4 Açıklama': DataCardValue24.Text,
 'K7 Istasyonun not aus ve switchlerinin kontrolü': DataCardValue62.Value,
 'K7 Açıklama': DataCardValue29.Text
 }
 ),
 "Haftalık1",
 Patch(
 'ML St110 Otonom Bakım',
 Defaults('ML St110 Otonom Bakım'),
 {
 'Content type': DataCardValue13.Selected,
 Title: DataCardValue1.Text,
 'K5 VPP 21 Bağlantısı kontrolü':DataCardValue11.Value,
 'K5 Açıklama':DataCardValue26.Text,
 'K6 Yırtılan,deforme olan laminasyon ve asetat kaplı (Kanban;TPM kartları vb.) kontrol edilmesi':DataCardValue28.Value,
 'K6 Açıklama':DataCardValue27.Text,
 'T12 İstasyon genel temizliği (istasyon arkası ve içi)':DataCardValue42.Value,
 'T12 Açıklama':DataCardValue41.Text,
 'K9 Mastar ile eksen kontrolü':DataCardValue34.Value,
 'K9 Açıklama':DataCardValue33.Text,
 'K12 Kesik DSM ile eksen kontrolü':DataCardValue19.Value,
 'K12 Açıklama':DataCardValue18.Text 
 
 
 }
 ),"Aylık1",

 Patch('ML St110 Otonom Bakım',Defaults('ML St110 Otonom Bakım'),

 {
 'Content type': DataCardValue13.Selected,
 Title: DataCardValue1.Text,
 'T13 DSM Vakum hattı temizliği':DataCardValue2.Value,
 'T13 Açıklama':DataCardValue3.Text,
 'K10 RT kilitleme ve Promess markalı pim ve cıvata bağlantıları kontrolü':DataCardValue4.Value,
 'K10 Açıklama':DataCardValue5.Text,
 'T15 St.110 Promess fan bölgesinin temizlenmesi ':DataCardValue6.Value,
 'T15 Açıklama':DataCardValue7.Text,
 'K13 Spaltabfrage sensör kablolarının ve bağlantılarının kontrolü':DataCardValue8.Value,
 'K13 Açıklama':DataCardValue9.Text
 
 },
 Form1.Updates

))

 

 

 

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

    Hi @Mythran ,

    Unfortunately you cannot Patch Attachments other than with Form.Updates. You could possibly have a separate form for the attachments.

     

    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.

    Visit my blog Practical Power Apps

  • Mythran Profile Picture
    57 on at

    Hello @WarrenBelz,

     

    is there any code sample that you can share with me. I'm kinda newbie that's why i need some help if you could.

  • MVP-Phipps Profile Picture
    3,521 Super User 2024 Season 1 on at

    @Mythran it can be done without using a form if that is what you are after. Please take a look at this: https://imperiumdynamics.com/blog/CanvasApps-UsingAttachmentControl-Without-Form

     

    Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful as can help others.

    LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
    YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
    Twitter: https://twitter.com/phipps0218

  • Mythran Profile Picture
    57 on at

    Hello @phipps0218,

     

    When i practice your solution, I'm getting error you can see in below picture. what could be the problem?

     

    Mythran_0-1658136955615.png

     

  • MVP-Phipps Profile Picture
    3,521 Super User 2024 Season 1 on at

    What is DataCardValue70?

  • WarrenBelz Profile Picture
    156,333 Most Valuable Professional on at

    @Mythran ,

    The last link posted is using Dataverse (I assume you are using SharePoint where this is not possible - please confirm this).

    The problem you also have is that these are new records - so this gets more complicated using a separate form I mentioned earlier. You can set a Variable like this

    Set(
     gblID,
     Patch(
     'ML St110 Otonom Bakım',
     Defaults('ML St110 Otonom Bakım'),
     {
     'Content type': DataCardValue13.Selected,
     Title: DataCardValue1.Text,
     'T13 DSM Vakum hattı temizliği':DataCardValue2.Value,
     'T13 Açıklama':DataCardValue3.Text,
     'K10 RT kilitleme ve Promess markalı pim ve cıvata bağlantıları 
     kontrolü':DataCardValue4.Value,
     'K10 Açıklama':DataCardValue5.Text,
     'T15 St.110 Promess fan bölgesinin temizlenmesi ':DataCardValue6.Value,
     'T15 Açıklama':DataCardValue7.Text,
     'K13 Spaltabfrage sensör kablolarının ve bağlantılarının 
     kontrolü':DataCardValue8.Value,
     'K13 Açıklama':DataCardValue9.Text 
     }
     ).ID
    )

    and then conditionally send the separate Attachment Control Form

    If(
     Whatever,
     Patch(
     'ML St110 Otonom Bakım',
     {ID: gblID},
     YourAttachmentForm.Updates
     )
    )

     

    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.

    Visit my blog Practical Power Apps

  • Mythran Profile Picture
    57 on at

    @phipps0218 wrote:

    What is DataCardValue70?


    attachment_card's datacard

  • Mythran Profile Picture
    57 on at

    @WarrenBelz wrote:

    @Mythran ,

    The last link posted is using Dataverse (I assume you are using SharePoint where this is not possible - please confirm this).

    The problem you also have is that these are new records - so this gets more complicated using a separate form I mentioned earlier. You can set a Variable like this

     

    Set(
     gblID,
     Patch(
     'ML St110 Otonom Bakım',
     Defaults('ML St110 Otonom Bakım'),
     {
     'Content type': DataCardValue13.Selected,
     Title: DataCardValue1.Text,
     'T13 DSM Vakum hattı temizliği':DataCardValue2.Value,
     'T13 Açıklama':DataCardValue3.Text,
     'K10 RT kilitleme ve Promess markalı pim ve cıvata bağlantıları 
     kontrolü':DataCardValue4.Value,
     'K10 Açıklama':DataCardValue5.Text,
     'T15 St.110 Promess fan bölgesinin temizlenmesi ':DataCardValue6.Value,
     'T15 Açıklama':DataCardValue7.Text,
     'K13 Spaltabfrage sensör kablolarının ve bağlantılarının 
     kontrolü':DataCardValue8.Value,
     'K13 Açıklama':DataCardValue9.Text 
     }
     ).ID
    )

     

    and then conditionally send the separate Attachment Control Form

     

    If(
     Whatever,
     Patch(
     'ML St110 Otonom Bakım',
     {ID: gblID},
     YourAttachmentForm.Updates
     )
    )

     

     

    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.

    Visit my blog Practical Power Apps


    Yes. I'm using sharepoint. 😞 

  • MVP-Phipps Profile Picture
    3,521 Super User 2024 Season 1 on at
    Set(
     gblID,
     Patch(
     'ML St110 Otonom Bakım',
     Defaults('ML St110 Otonom Bakım'),
     {
     'Content type': DataCardValue13.Selected,
     Title: DataCardValue1.Text,
     'T13 DSM Vakum hattı temizliği':DataCardValue2.Value,
     'T13 Açıklama':DataCardValue3.Text,
     'K10 RT kilitleme ve Promess markalı pim ve cıvata bağlantıları 
     kontrolü':DataCardValue4.Value,
     'K10 Açıklama':DataCardValue5.Text,
     'T15 St.110 Promess fan bölgesinin temizlenmesi ':DataCardValue6.Value,
     'T15 Açıklama':DataCardValue7.Text,
     'K13 Spaltabfrage sensör kablolarının ve bağlantılarının 
     kontrolü':DataCardValue8.Value,
     'K13 Açıklama':DataCardValue9.Text 
     }
     ).ID
    )

     

    and then conditionally send the separate Attachment Control Form

     

    If(
     Whatever,
     Patch(
     'ML St110 Otonom Bakım',
     {ID: gblID},
     YourAttachmentForm.Updates
     )
    )

     

    Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful as can help others.

    LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
    YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
    Twitter: https://twitter.com/phipps0218

  • WarrenBelz Profile Picture
    156,333 Most Valuable Professional on at

    @phipps0218 ,
    That is exactly what I posted ??? Not sure what value that adds  . . .

    @Mythran ,

    Just let me know if you want further explanation.

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard