Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Know if Power Apps can auto-save gallery information

(1) ShareShare
ReportReport
Posted on 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 at
    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
    21,991 Super User 2025 Season 1 on at
    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 at
    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
    146,524 Most Valuable Professional on at
    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
    21,991 Super User 2025 Season 1 on at
    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 at
    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
    21,991 Super User 2025 Season 1 on at
    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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard