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 / Error in Add attachmen...
Power Apps
Unanswered

Error in Add attachments to sharepoint list

(0) ShareShare
ReportReport
Posted on by

The code is sending all the fields correctly except the attachment, all the fields go up to the sharepoint list but the attachment field is always empty, can you help?

 

Glaysonbk_1-1704288980706.pngGlaysonbk_2-1704289038096.png

Glaysonbk_3-1704289202338.png

 

 


UpdateContext(
{
loc_PatchRecursos:
Patch(
Lista_Recursos;
Defaults(Lista_Recursos);
{
TipoSolicitacao: TipoRecurso_2.Selected.Value;
Acao: AcaoRecurso_2.Selected.Value;
Motivos: Motivos_sol_2.Selected.Value;
Criterio: Criterio_2.Selected.Value;

Sit_Red: Sit_Red_2.Selected.Value;
Num_processo: Num_processo_6.Value;
CicloPosterior: CicloPosterior_2.Selected.Value;
ConsumoFixado: ConsumoFixado_4.Value;
Valor_Fixado: ValorFixado_4.Value;
Observações: Observacoes_4.Value;
InicioIrregularidade: DataInicioFraude_2.SelectedDate;
InicioRecuperacao: DataInicioRec_2.SelectedDate;
CDC: CDC_4.Value;
Projeto: Projeto_4.Value;
Campanha: Campanha_4.Value;
SUC: SUC_4.Value;
Empresa: Empresa_2.Selected.Value;
TOI:TOI_4.Value;
Fim_rec: DataFimRec_2.SelectedDate;

Anexos: AnexarDocs;
Data_Cliente_Solicitou: Data_Cliente_Solicitou_1.SelectedDate;
Id_Recurso: GUID() & Text(Now(); "ddmmyyhhmmss");
Status_atual: "Novo";
Data_abertura: Text(Now())
}
)
}
);;
Patch(
Lista_Recursos;
loc_PatchRecursos;
{
CopiaID: loc_PatchRecursos.ID
}
);;

Patch(
log_recursos_solicitacoes;
Defaults(log_recursos_solicitacoes);
{
FK_ID_Recurso: loc_PatchRecursos.Id_Recurso;
TipoModificacao: "Novo Recurso"
}
);;
UpdateContext({LocNovoRecurso2:false});;
Reset(TipoRecurso_2);;
Reset(AcaoRecurso_2);;
Reset(Criterio_2);;
Reset(Sit_Red_2);;
Reset(Num_processo_6);;
Reset(CicloPosterior_2);;
Reset(ConsumoFixado_4);;
Reset(ValorFixado_4);;
Reset(Observacoes_4);;
Reset(CDC_4);;
Reset(TOI_4);;
Reset(Empresa_2);;
Reset(DataInicioFraude_2);;
Reset(DataInicioRec_2);;
Reset(AnexarDocs);;
Reset(Data_Cliente_Solicitou_1);;
Reset(DataFimRec_2)

Categories:
I have the same question (0)
  • Rajkumar_M Profile Picture
    3,741 Super User 2025 Season 2 on at

    Hi @Glaysonbk 

     

    Currently Patch does not support attachments.

     

    Refer this blog's this may help you: https://www.matthewdevaney.com/power-apps-easiest-way-to-upload-files-to-a-sharepoint-document-library/

     

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Is-it-possible-to-use-Patch-Function-to-patch-the-attachment/td-p/604861

     

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Need-to-add-Attachment-to-a-PATCH-to-a-SharePoint-List/td-p/158968

     

     

    Thanks!

     

    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.

  • mmbr1606 Profile Picture
    14,605 Super User 2025 Season 2 on at

    hey @Glaysonbk 

     

    i might have a solution for you that could work, currently i have my company laptop already turned off, i will answer you tomorrow morning. maybe you can comment back so i can find it easier

     

    thanks 😉

  • mmbr1606 Profile Picture
    14,605 Super User 2025 Season 2 on at

    i started my machine to show you what i did and it works.

     

    i inserted a form and deleted all datacards besides the attachment one (this is key to achieve this solution)

     

    mmbr1606_0-1704308232316.png

     

    after the patch statement itself i just put ,Form5.Updates) please make sure that you replace Form5 with the name of the Form.

     

    after that you can put a ; and just continue with your Resets and other stuff.

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard