web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / ID DEJA DE FUNCIONAR
Power Apps
Suggested Answer

ID DEJA DE FUNCIONAR

(1) ShareShare
ReportReport
Posted on by 82
Hola
 
Tengo un boton ButtonCanvas3 y una galeria Gallery1 en la cual tengo una lista desplegable Dropdown2 un TextInput3 y un TextInput4 los cuales al momento de darle clic a mi boton me agregaba otro campo en mi galeria con esos textinpuy y el dropdown pero ya van varias veces que deja de funcionar ¿A que se puede deber? no modifico nada de mi Boton
 
Me deberia o me salia otra linea debajo de EN_PROCESO pero dejo de funcionar
 
Tengo 2 tablas Tickets y StatusTicket, en las 2 tablas me agrega el ID que es tipo Busqueda
 
 
 
El boton Onselect he intentado con este codigo que si me agregaba el ID_Ticket
 
Patch(
StatusTicket;
Defaults(StatusTicket);
{
ID_Ticket: {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";
Id: varNuevoRegistro;
Value: Text(varNuevoRegistro)
};

// Se recomienda Now() directo a menos que necesites forzar un desfase específico
Fecha: DateAdd(Now(); -TimeZoneOffset(Now()); TimeUnit.Minutes);

TipoStatus: {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";
Id: 1;
Value: "ABIERTO"
}
}
)
I have the same question (0)
  • Suggested answer
    11manish Profile Picture
    1,496 on at
    Your issue is not the button—it’s that the new record is being created but not appearing in the gallery, most likely due to lookup value mismatch, missing refresh, or gallery filtering.
     
    Fix the lookup Value, ensure correct filter, and add Refresh(StatusTicket) after Patch.
     
    Try below Patch Code :
     
    Patch(
        StatusTicket,
        Defaults(StatusTicket),
        {
            ID_Ticket: {
                Id: varNuevoRegistro,
                Value: LookUp(Tickets, ID = varNuevoRegistro).Title
            },
            Fecha: Now(),
            TipoStatus: {
                Id: 1,
                Value: "ABIERTO"
            }
        }
    );
    Refresh(StatusTicket)
     
  • Suggested answer
    Valantis Profile Picture
    3,475 on at
     
    Your button is running and creating records the empty row from 21/04/2026 in your StatusTicket table proves it. But varNuevoRegistro is empty when the button fires, so ID_Ticket gets no value.
    The fix is to make sure varNuevoRegistro is set before the Patch runs. The most reliable way is to set it inside the same button OnSelect, right before the Patch, using the ID of the selected gallery item:
    Set(varNuevoRegistro, Gallery1.Selected.ID);
    Patch(
        StatusTicket,
        Defaults(StatusTicket),
        {
            ID_Ticket: {
                '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";
                Id: varNuevoRegistro,
                Value: Text(varNuevoRegistro)
            },
            Fecha: DateAdd(Now(), -TimeZoneOffset(Now()), TimeUnit.Minutes),
            TipoStatus: {
                '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
                Id: 1,
                Value: "ABIERTO"
            }
        }
    );
    Refresh(StatusTicket)
    Also add Refresh(StatusTicket) at the end as the other user suggested without it the gallery won't show the new row even if the record was created correctly.
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

    💼 LinkedIn

    ▶️ YouTube

  • IS-12031616-0 Profile Picture
    82 on at
    Que tal 11manish y Valantis 
     
    Probé con los 2 codigós pero ninguno me agrego el ID correspondiente (148), no se si este haciendo algo mal o falte algo por lo cual no me asigna el ID_Ticket
     
     
    Este es el codigo que tengo para agregar un ticket que es el principal que me genera en mis 2 listas al mismo tiempo StatusTicket y Tickets
     
    Set(varNuevoRegistro;FormNuevoTicket_Ag.LastSubmit.ID) &&
     
    Concurrent(
        // Restablecer el formulario y ocultar el popup
        ResetForm(FormNuevoTicket_Ag);
        NewForm(FormNuevoTicket_Ag);
     
        Set(varPopupVisible; false);
     
        // Guardar el usuario actual desde la lista Usuarios (donde el Correo coincide con el User().Email)
        Set(varUsuarioActual; LookUp(Usuarios; Correo = User().Email));
     
        //
     
        // Crear registro en StatusTicket
        Patch(
            StatusTicket;
            Defaults(StatusTicket);
            {
                //ID_Ticket: FormNuevoTicket.LastSubmit."ID"
     
                ID_Ticket: {
                Id: varNuevoRegistro;
                Value: Text(varNuevoRegistro)
            };
     
                //Fecha:Now();
                Fecha: DateAdd(Now(); -TimeZoneOffset(Now()); TimeUnit.Minutes);
     
                TipoStatus:{'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";
                Id:1;
                Value:""
                }
            }
        );
     
        // Mostrar mensaje de éxito
        Notify("Ticket creado correctamente"; NotificationType.Success)
     
     
       
    ) &&
     
    Notify("Ticket actualizado correctamente"; NotificationType.Success)
  • WarrenBelz Profile Picture
    155,074 Most Valuable Professional on at
    I may be wrong here (if so please disregard this post), but you seem to be trying to Patch a SharePoint Lookup field. If this is the case, you need to refer to the other list being looked up like this (use your list and field names - the odata.type reference also is no longer needed)
    Patch(
       StatusTicket;
       Defaults(StatusTicket);
       {
       ID_Ticket: 
       {
          Value: Text(varNuevoRegistro);
          Id: 
          LookUp(
             YourOtherListName;
             YourLookedUpFieldName = varNuevoRegistro
          ).ID
       }
    };
    I have one question though - is varNeuvoRegistro text (the name of the field) or a number ?
     
    Please Does this answer your question 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 answering Yes to Was this reply helpful? or give it a Like
    Visit my blog
    Practical Power Apps    LinkedIn  
  • IS-12031616-0 Profile Picture
    82 on at
     Hola WarrenBelz
     
    intenten con el codigo que me comentas pero sigue igual solo agrega el campo fecha, alguna recomendación que este haciendo mal con mi galeria o boton, no se por que no detecta el ID
     
    Patch(
       StatusTicket;
       Defaults(StatusTicket);
       {
          ID_Ticket: {
             Value: Text(varNuevoRegistro);
             Id: LookUp(Tickets; ID = varNuevoRegistro).ID
          }
       }
    )
     
     
  • WarrenBelz Profile Picture
    155,074 Most Valuable Professional on at
    Before we go any further, what is ivarNuevoRegistro ? Is it the name of the ticket (text) or the ID of the Ticket (number)?  I need to see exactly what you are trying to retreive here.
    So please confirm that 
    • ID_Ticket is a SharePoint Lookup column
    • If so, it is referencing a field in the Tickets list - what is the field name it is referencing
    Can you please post a screen shot of the field settings from SharePoint.
  • IS-12031616-0 Profile Picture
    82 on at
    Es el ID del ticket numero tipo busqueda
     
    • ID_Ticket es una columna de búsqueda de SharePoint. (SI)
    • Si es así, hace referencia a un campo de la  lista de Tickets  . ¿Cuál es el nombre del campo al que hace referencia? (Id)
     
    Tickets
     
    StatusTickets
  • WarrenBelz Profile Picture
    155,074 Most Valuable Professional on at
    I tested this here on the same setup
    Patch(
       StatusTicket;
       Defaults(StatusTicket);
       {
          ID_Ticket: {
             Value: Text(varNuevoRegistro);
             Id: varNuevoRegistro
          }
       }
    )
    
    and it worked for me. I created a lookup column based on the ID of another list and patched a new record. I received an entry, which when clicked on in SharePoint opened the related record in the other list. Not sure what you have done wrong here. I assume that your Variable is a number and the ID exists in the other list ?
  • IS-12031616-0 Profile Picture
    82 on at
    Hola WarrenBelz
     
    He probado de todo y no se me agrega ese ID, te agradeceria muchisimo si me puedes brindar soporte, asesoria via remota ya se por TeamViewer, Anydesk o Asistencia rapida de windows
     
    Te dejo mis datos por si tienes tiempo libre me puedas ayudar porfavor
    +52 314-147-9084
     
    Saludos
  • WarrenBelz Profile Picture
    155,074 Most Valuable Professional on at
    Before we look at that, can you please send a screenshot of your field settings for ID_Ticket as below (which is what I was after in my earlier post)
     
     
    Also what time zone are you in and how is your Engish (I am from Australia)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 522

#2
WarrenBelz Profile Picture

WarrenBelz 437 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 405

Last 30 days Overall leaderboard