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.

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.

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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