cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CarlosN
Helper IV
Helper IV

Update registration in Gallery

Good night,
I have this form where I save records in a Sharepoint database, once I have saved the record I want the last record created to be selected so that I can continue adding information to that last record created. Currently the information records me but the gallery item is always selected

2 ACCEPTED SOLUTIONS

Accepted Solutions

@CarlosN ,

This would be so mush easier with a form and I am wondering why you have not used one with such a big Patch, however if you do this below (note I OCR'd this, so just copy the top 2 lines and the last bracket)

Set(
   vCurrRec;
   Patch(
      'Solicitudes Exprès';
      Defaults('Solicitudes Exprès');
      {
         Cliente: TxtCliente_l.Text;
         Nit : TxtNit_l.Text;
         CodigoCliente: TxtCodCliente_l.Text;
         Referencia: TxtReferencia_l.Text;
         Producto: TxtProducto_l.Text;
         VieneDe: TxtVieneDe_l.Text;
         CopiarDe: TxtCopiorDe_l.Text;
         Largo: TxtLargo_l.Text;
         Ancho: TxtAncho_l.Text;
         Alto: TxtAlto_l.Text;
         Material : CBoxMaterioi_l.Selected.Material;
         Cierre: DdownPegue_l.SelectedText.Value;
         Estilo: DdownEstiLos_l.SelectedText.Value;
         Color: DdownColores_l.SelectedText.Value;
         Caras : DdownCaras_l.SelectedText.Value;
         UsuarioVentas: DropUsuarioVentas_l.SelectedText.Result;
         FechaCreacion: FechoSoicitud_l.SelectedDate;
         EmailUsuario: LblEmail_l.Text;
         CiudadDespacho: TxtCiudodDespacho_l.Text;
         Observacion: TxtObservaciones_l.Text;
         Planta: LblPlanto_l.Text
      }
   )
);;
UpdateContext({ColorBt:true})

then you should be able to display the record you would need by setting the Default of each control to (examples) Cliente

vCurrRec.Cliente

Nit

vCurrRec.Nit

 

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.

View solution in original post

Hi @CarlosN ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

View solution in original post

7 REPLIES 7
WarrenBelz
Super User III
Super User III

Good Afternoon @CarlosN (Sunday here),

You can do this, but a probably bit of a change to your current structure.

Firstly, the OnSelect of the Gallery should be this (call the Variable whatever you want)

Set(vID, ThisItem.ID)

Then the Item of the form

Lookup(
   YourListName,
   ID=vID)
)

now you have done this, you can display on the form whatever record the ID equals vID, so on the OnSuccess of the form

Set(
   vID, 
   YourFormName.LastSubmit.ID
)

 and this will display the record you have just created.

 

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.

Hi Warren,

Thanks for your hepl.

But it is not an edit form, they are text boxes, drop-down lists, ...

Hi @CarlosN ,

That is going to make it a bit more difficult. How do you display existing records in them and what is your Patch code you use for new records?

Good Morning,
This is the Pacth code, I am using.

@CarlosN ,

This would be so mush easier with a form and I am wondering why you have not used one with such a big Patch, however if you do this below (note I OCR'd this, so just copy the top 2 lines and the last bracket)

Set(
   vCurrRec;
   Patch(
      'Solicitudes Exprès';
      Defaults('Solicitudes Exprès');
      {
         Cliente: TxtCliente_l.Text;
         Nit : TxtNit_l.Text;
         CodigoCliente: TxtCodCliente_l.Text;
         Referencia: TxtReferencia_l.Text;
         Producto: TxtProducto_l.Text;
         VieneDe: TxtVieneDe_l.Text;
         CopiarDe: TxtCopiorDe_l.Text;
         Largo: TxtLargo_l.Text;
         Ancho: TxtAncho_l.Text;
         Alto: TxtAlto_l.Text;
         Material : CBoxMaterioi_l.Selected.Material;
         Cierre: DdownPegue_l.SelectedText.Value;
         Estilo: DdownEstiLos_l.SelectedText.Value;
         Color: DdownColores_l.SelectedText.Value;
         Caras : DdownCaras_l.SelectedText.Value;
         UsuarioVentas: DropUsuarioVentas_l.SelectedText.Result;
         FechaCreacion: FechoSoicitud_l.SelectedDate;
         EmailUsuario: LblEmail_l.Text;
         CiudadDespacho: TxtCiudodDespacho_l.Text;
         Observacion: TxtObservaciones_l.Text;
         Planta: LblPlanto_l.Text
      }
   )
);;
UpdateContext({ColorBt:true})

then you should be able to display the record you would need by setting the Default of each control to (examples) Cliente

vCurrRec.Cliente

Nit

vCurrRec.Nit

 

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.

View solution in original post

Hi @CarlosN ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

View solution in original post

Good Morning, I have not tried it yet, as soon as I have a while to run it I have had other problems that I have not resolved. I will continue consulting the powerapps community to solve my doubts.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,040)