Skip to main content
Community site session details

Community site session details

Session Id : htmXryhg6mod6fTqfLdPR+
Power Apps - Building Power Apps
Answered

Know if Power Apps can auto-save gallery information

Like (1) ShareShare
ReportReport
Posted on 5 Jul 2024 16:15:04 by

Very good day,

Please I need your help. I am reading cards through QR and, when I accumulate a quantity of information, I save and send these readings to SharePoint. I want to know if it is possible to implement an auto save that, when recording one or two readings, is automatically saved, performing the same process as the save button.

Thank you so much.

andresnex_0-1720195802485.png

 

save code:  
I want to generate an autosave with or without a button when there are records in the list

 

Set(_informacion;Defaults(Registro_Asistencia));;

ForAll( Gallery1.AllItems ;
Patch(Registro_Asistencia;_informacion;
{
    TĂ­tulo:If(
CountRows(Split( Title1.Text ;","  )) >= 5 ;
 Index(Split(Title1.Text; ","); 1).Value;
" "
);
               
  Upi_Empleado:If(
              CountRows(Split(Title1.Text; ",")) >= 5;
              Index(Split(Title1.Text; ","); 2).Value;
               Index(Split(Title1.Text; ","); 1).Value
    );

Cedula:Index(Split(Title1.Text; ","); If(CountRows(Split(Title1.Text; ",")) >= 5; 3; 2)).Value;

Nombre_Empleado:Index(Split(Title1.Text; ","); If(CountRows(Split(Title1.Text; ",")) >= 5; 4; 3)).Value;

Rh:Index(Split(Title1.Text; ","); If(CountRows(Split(Title1.Text; ",")) >= 5; 5; 4)).Value;

Tipo_Capacitacion:Dropdown2.Selected.Value;
Curso: TextInput1_1.Text  ;
Fecha:DatePicker1.SelectedDate;
Hora:Dropdown1.Selected.Value;
Horario:Dropdown1_1.Selected.Value;
Duracion:Label2.Text;
Objetivo:TextInput1_5.Text;
Facilitador:TextInput1_6.Text;
Upi_Facilitador:TextInput1_7.Text;
Categoria_Zoom:Dropdown2_2.Selected.Value;
Estrategia_Nexans:Dropdown2_1.Selected.Value

}

)
);;

Notify("Guardada la informacion");;
Clear(ScanColeccion);;
 




  • andresnex Profile Picture
    on 08 Jul 2024 at 18:19:27
    Re: Know if Power Apps can auto-save gallery information

    @BCBuizer  Thank you very much, the process worked for me

  • Verified answer
    BCBuizer Profile Picture
    22,262 Super User 2025 Season 2 on 08 Jul 2024 at 07:46:29
    Re: Know if Power Apps can auto-save gallery information

    Hi @andresnex ,

     

    You may use a Timer control that runs when the screen is visible and saves the contents when it runs out and then resets. More details can be found here: Solved: Autosave with timer control with loop enabled - Power Platform Community (microsoft.com)

  • andresnex Profile Picture
    on 07 Jul 2024 at 16:55:54
    Re: Know if Power Apps can auto-save gallery information

    Hello @BCBuizer , the formula has no problem,   
    What I'm looking for is for the information to save itself when there are records in the gallery, without the button

  • WarrenBelz Profile Picture
    148,842 Most Valuable Professional on 07 Jul 2024 at 11:27:09
    Re: Know if Power Apps can auto-save gallery information

    @andresnex ,

    Only coming in here briefly to suggest something to avoid all of that repetition

    ForAll( 
     Gallery1.AllItems As _Item;
     With(
     {
     _Data:
     Split( 
     _Item.Title1.Text;
     "," 
     )
     },
     Patch(
     Registro_Asistencia;_informacion;
     {
     TĂ­tulo:
     If(
     CountRows(_Data) >= 5;
     Index(_Data, 1).Value;
     " "
     ); 
     Upi_Empleado:
     If(
     CountRows(_Data) >= 5;
     Index(_Data; 2).Value;
     Index(_Data; 1).Value
     );
     Cedula:
     Index(
     _Data,
     If(CountRows(_Data) >= 5; 3; 2)
     ).Value;
     Nombre_Empleado:
     Index(
     _Data,
     If(CountRows(_Data) >= 5; 4; 3)
     ).Value;
     Rh:
     Index(
     _Data,
     If(
     CountRows(_Data) >= 5; 5; 4)
     ).Value;
     Tipo_Capacitacion: Dropdown2.Selected.Value;
     Curso: TextInput1_1.Text ;
     Fecha: DatePicker1.SelectedDate;
     Hora: Dropdown1.Selected.Value;
     Horario: Dropdown1_1.Selected.Value;
     Duracion: Label2.Text;
     Objetivo: TextInput1_5.Text;
     Facilitador: TextInput1_6.Text;
     Upi_Facilitador: TextInput1_7.Text;
     Categoria_Zoom: Dropdown2_2.Selected.Value;
     Estrategia_Nexans: Dropdown2_1.Selected.Value
     }
     )
     )
    );;
  • BCBuizer Profile Picture
    22,262 Super User 2025 Season 2 on 06 Jul 2024 at 06:46:09
    Re: Know if Power Apps can auto-save gallery information

    Hi @andresnex ,

     

    That part is understood, but what is the issue with the formula? Does it not perform the task or you don't know how to trigger it?

  • andresnex Profile Picture
    on 05 Jul 2024 at 18:35:50
    Re: Know if Power Apps can auto-save gallery information

    @BCBuizer  Hello, what I want is that when you have 2 or 3 records the system performs the saving, in this way the system allows you to save by clicking the button or automatically saves with 3 records

  • BCBuizer Profile Picture
    22,262 Super User 2025 Season 2 on 05 Jul 2024 at 16:21:59
    Re: Know if Power Apps can auto-save gallery information

    Hi @andresnex ,

     

    Having had a quick look at your formula, you seem to be missing a reference to the current item in the ForAll loop. In case the issue is that the same values are saved for all items in the gallery, please try this formula:

    ForAll( Gallery1.AllItems As _Item;
    Patch(Registro_Asistencia;_informacion;
    {
     TĂ­tulo:If(
    CountRows(Split( _Item.Title1.Text ;"," )) >= 5 ;
     Index(Split(_Item.Title1.Text; ","); 1).Value;
    " "
    );
     
     Upi_Empleado:If(
     CountRows(Split(_Item.Title1.Text; ",")) >= 5;
     Index(Split(_Item.Title1.Text; ","); 2).Value;
     Index(Split(_Item.Title1.Text; ","); 1).Value
     );
    
    Cedula:Index(Split(_Item.Title1.Text; ","); If(CountRows(Split(_Item.Title1.Text; ",")) >= 5; 3; 2)).Value;
    
    Nombre_Empleado:Index(Split(_Item.Title1.Text; ","); If(CountRows(Split(_Item.Title1.Text; ",")) >= 5; 4; 3)).Value;
    
    Rh:Index(Split(_Item.Title1.Text; ","); If(CountRows(Split(_Item.Title1.Text; ",")) >= 5; 5; 4)).Value;
    
    Tipo_Capacitacion:_Item.Dropdown2.Selected.Value;
    Curso: _Item.TextInput1_1.Text ;
    Fecha:_Item.DatePicker1.SelectedDate;
    Hora:_Item.Dropdown1.Selected.Value;
    Horario:_Item.Dropdown1_1.Selected.Value;
    Duracion:_Item.Label2.Text;
    Objetivo:_Item.TextInput1_5.Text;
    Facilitador:_Item.TextInput1_6.Text;
    Upi_Facilitador:_Item.TextInput1_7.Text;
    Categoria_Zoom:_Item.Dropdown2_2.Selected.Value;
    Estrategia_Nexans:_Item.Dropdown2_1.Selected.Value
    
    }
    
    )
    );;
    
    Notify("Guardada la informacion");;
    Clear(ScanColeccion);;

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete