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 / ENLAZAR UN TEXTINPUT C...
Power Apps
Suggested Answer

ENLAZAR UN TEXTINPUT CON UN DATACARD

(0) ShareShare
ReportReport
Posted on by 41
Hola 
 
Como le puedo hacer para que mi TextInput2 tome el valor de mi DataCardValue7 y lo guarde en mi columna Detalles
 
Actualmente  mi tabla se llama StatusTicket y tengo la columna Detalles y Obvservaciones
 
Lo cual me guarda todo en su lugar pero mi TextInput2 es independiente de mi DataCardValue7 y me gustaria que lo que tenga en DataCardValue7 se refleje en mi TextInput2
 
 
Mi DataCardValue7 es desblegable 
 
Items > Choices([@Tickets].UltimoEstatus)
ItemDisplayText > ThisItem.Value
 
 
 
Mi TextInput2 es de escribir
 
Default> ThisItem.Detalles
Onchange > Patch(StatusTicket;ThisItem;{Detalles:TextInput2.Text})
 
 
Intente cambiando en mi TextInput2 > Default > DataCardValue7.Selected.Value pero NO me guarda  
 
I have the same question (0)
  • Suggested answer
    Sunil Kumar Pashikanti Profile Picture
    1,628 Moderator on at
     
    In Power Apps:
    • Default is only used when the control loads
    • When the user types, the Default value is no longer used
    • If the record changes, Default does not refresh automatically
    • Dropdown and TextInput do not auto-sync
    So this formula alone is not enough:
              TextInput2.Default = DataCardValue7.Selected.Value

    Correct and recommended solution
    Step 1: Create a variable to keep values in sync
    In DataCardValue7.OnChange:
              Set(varDetalle, DataCardValue7.Selected.Value)
    This stores the selected value in a variable.
     
    Step 2: Use the variable in TextInput2
    Set TextInput2.Default property as follows:

    If(
        IsBlank(varDetalle),
        ThisItem.Detalles,
        varDetalle
    )
     
    This means:
         If nothing is selected yet, show the saved Detalles
         If a value is selected in the dropdown, show it
     
    Step 3: Update the variable when typing in TextInput2
    Set TextInput2.OnChange
              Set(varDetalle, TextInput2.Text)
    Now TextInput2 and DataCardValue7 stay synchronized.

    Step 4: Save the value correctly
    In your Save button (recommended) or form submit:
    Patch(
        StatusTicket,
        ThisItem,
        { Detalles: varDetalle }
    )
    This ensures the final text (whether selected or typed) is saved.

    Important best practices
    Do NOT use Patch in TextInput.OnChange unless absolutely needed
    Always save data in one place (Save button or Form Submit)
    Use variables to sync multiple controls
    Dropdowns do not automatically update TextInputs
     

    ✅ If this answer helped resolve your issue, please mark it as Accepted so it can help others with the same problem.
    👍 Feel free to Like the post if you found it useful.
  • WarrenBelz Profile Picture
    154,941 Most Valuable Professional on at
    I will give you three simple options of the Default property of the Text Input required depending on what you want to happen: -
    1. If you want the value to be whatever is in the drop-down always (even if it is blank)
      DataCardValue7.Selected.Value
    2. If you want to display the current value from your data source if the drop-down is blank, but change to the drop-down value if something is selected there.
      Coalesce(
         DataCardValue7.Selected.Value,
         ThisItem.Detalles
      )
    3. If you want to only over-ride with the drop-down value if the text data source value is blank (do not overwrite if something is already there)
      Coalesce(
         ThisItem.Detalles,
         DataCardValue7.Selected.Value
      )
    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
    41 on at
    Hola  y   Muchas gracias por la respuesta.
     
     
    Los 2 códigos me funcionan, como le puedo hacer para que al momento de darle nuevo registro me agregue otro en mi gallry1 y sea independiente cada registro TextInput2
     
     
    Tengo en el FormNuevoTicket_AG el siguiente codigo que es el que me asigna el ID en este caso 140
     
    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)
    Actualmente tengo en el OnSelect del botón Nuevo registro 
     
    // Crear registro en StatusTicket
        Parche (
            Ticket de estado ;
            Valores predeterminados ( StatusTicket );
            {
                //ID_Ticket: FormNuevoTicket.LastSubmit."ID"
     
                ID_Ticket: {
                Id: varNuevoRegistro ;
                Valor: Texto ( varNuevoRegistro )
            };
     
                //Fecha:Now();
                Fecha: DateAdd ( Now (); - TimeZoneOffset ( Now ()); TimeUnit . Minutes );
     
                TipoStatus: { '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference" ;
                Id: 1 ;
                Valor: "ABIERTO"
                }
            }
        )
     
    si me crea un registro en Sharepoint pero solo me agrega la fecha sin el ID_Ticket, deberia de ponerme 140 
     
    Tengo 2 tablas Tickets y StatusTicket en la cual
     
    FormTickets_AG guarda en Entradas 
     
    Gallery1 guarda en StatusTicket
  • WarrenBelz Profile Picture
    154,941 Most Valuable Professional on at
    Breaking this down a bit to the relevant part, you are setting varNuevoRegistro to the ID value of the record last submitted by FormNuevoTicket_Ag
    Set(
       varNuevoRegistro;
       FormNuevoTicket_Ag.LastSubmit.ID
    )
    You did not say where or when you you running this. In that piece of code, you are then patching StatusTicket with a new record and using
    ID_Ticket: 
    {
       Id: varNuevoRegistro;
       Value: Text(varNuevoRegistro)
    };
    So my first question is what type of field is ID_Ticket - it seems to be a lookup ?
     
    The second piece of code is also patching StatusTicket (is this an error and should be the other list you refer to Tickets ) ? You are using the same code as above for ID_Ticket, so two issues - is it also the same field type and (more importantly) does varNuevoRegistro actually have a value in it at that point in time (you set it in earlier code) - a blank Variable would explain the lack of data in that field.
     
    Could you also post (in Text) the Items of both of those galleries.
     
    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
    41 on at
    Hola nuevamente
     
    Te explico todo el procedimiento 
     
    Tengo un boton Nuevo Registro para agregar el registro principal que se llama NewRecordButton1_Ag y en OnSelect tiene 
     
    If(true; Set(varPopupVisible; true); NewForm(FormNuevoTicket_Ag))
    -
    -
    -
     
    Tengo un formulario FormNuevoTicket_Ag y en OnSuccess tiene 
     
    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)
    -
    -
    tengo un boton ButtonGuardar_Ag para guardar ese formulario y en OnSelect tiene 
     
    SubmitForm(FormNuevoTicket_Ag)
    -
    -
    -
    Una vez dando guardar al boton del formulario se almacenan mis datos en 2 tablas (Tickets) y (Statusticket)
     
    asi es como me sale ya con ID identificado que es consecutivo (140,etc,148)
     
     
     
     
     
     
    HASTA AQUI TODO BIEN
     
    Tengo esta Galeria que se llama Gallery1 y contiene(Dropdown - TextInput3 - TextInput4) la cual esta enlazada o con origenes de datos de la tabla Statustickets y como la genera con el mismo ID si me me muestra el primer registro 
     
    Pero al yo querer agregar 1 o 3 o mas registros solamente me los agrega en la tabla StatusTicket por que no se le asigna el ID_Ticket
     
    El boton Nuevo Registro se llama ButtonCanvas3 y en OnSelect tiene 
     
    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"
            }
        }
    )
     
    Si me agrega un nuevo registro en sharepoint pero como no agrega el ID en este caso 148 pues no me lo muestra en la aplicacion
  • WarrenBelz Profile Picture
    154,941 Most Valuable Professional on at
    There are a number of important questions I asked on my last post that you have not provided details on: -
    • What type of field is ID_Ticket ?
    • What is the Items property of both of those galleries ?
    • We are dealing with two lists here - I assume that FormNuevoTicket_Ag is based on Tickets and when it is submitted, the Ticket_ID  is correctly saved. Please confirm this.
    If the last item is correct, there is only one important part here - highlighted below. You also do not need the odata reference lines I have removed.
    Patch(
       StatusTicket;
       Defaults(StatusTicket);
       {
          ID_Ticket: {
             Id: varNuevoRegistro;
             Value: Text(varNuevoRegistro)
          };
          Fecha: DateAdd(Now(); -TimeZoneOffset(Now()); TimeUnit.Minutes);
          TipoStatus: {
             Id: 1;
             Value: "OPEN"
          }
       }
    )
    If Ticket_ID is a Lookup field, which list and which field (and field type) is it looking up ? Can you please also confirm the same for TipoStatus.
     
    I am going to take a guess here (the code below is incorrect if I am wrong) and that ID_Ticket is a lookup field referencing a field of the same name in Tickets, which is a Text field. If this is the case then
    Patch(
       StatusTicket;
       Defaults(StatusTicket);
       {
          ID_Ticket:
          {
             Value: Text(varNuevoRegistro)
             Id: LookUp(
                Tickets As _T;
                _T.ID_Ticket = _ID_Ticket
             ).ID
          };
          Fecha: DateAdd(Now(); -TimeZoneOffset(Now()); TimeUnit.Minutes);
          TipoStatus: {
             Id: 1;
             Value: "OPEN"
          }
       }
    )
     
    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  

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 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard