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
Super User

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,717)