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 / como realizar un patch...
Power Apps
Unanswered

como realizar un patch desde un campo de texto a un campo de búsqueda

(0) ShareShare
ReportReport
Posted on by 18

Buenas necesito pasar datos desde una colección a una tabla de dataverse. En la tabla de dataverse uno de los campos de destino es un campo de búsqueda porque está relacionado con otra tabla. Tengo que pasar un dato de un campo de texto a un campo de búsqueda. lo hago a través de un bucle for all. Este es la parte del código.

 

ForAll(Tabla1;
Patch(
colListadoPrec;Defaults(colListadoPrec);
{

lstReferencia:LookUp(pr_Productos;Referencia=ThisRecord.ReferenciaE);
cr043_precinto: ThisRecord.Precinto;)
}
));;
Collect(pr_Listado;colListadoPrec)

 

 

 

No me reconoce el campo ReferenciaE del origen de datos, ¿cómo puedo pasar el dato del campo ReferenciaE (texto) al campo lstReferencia de la colección (campo de búsqueda?.

Gracias, un saludo

Categories:
  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Javier_Gonz,

    Do you want to patch the whole text field or a value in the text field in a collection to a Dataverse LookUp field?

    Could you please share a bit more about the scenario?

    Actually, if you want to patch a collection to a Dataverse table, you should ForAll the collection rather than the table.

    In addition, I want to explain to you that since you have a related table to the Tabla1, the text field from the collection should be totally same as the Text field in the related table. 

    However, from your description, you should want to patch a specific value to the lstReferencia, right?

    If so, I think you should remove the ForAll(), please take a try as below:

    Patch(Tabla1;
    Defaults(Tabla1);
    {
    lstReferencia:LookUp(pr_Productos;Referencia=ThisRecord.ReferenciaE); // A specifc value
    cr043_precinto: ThisRecord.Precinto;)
    }
    ))

    Check if it could help you.

    If this could not solve your issue, just feel free to tell me that if you want to patch a value or a whole field to a Dataverse LookUp field.

    Regards,

    Qi

  • Javier_Gonz Profile Picture
    18 on at

    Thank you for your help.

     

    I've found the problem. There were a problem when use ThisRecord inside the lookup, I've written the code so:

     

    ForAll(Tabla1 as T1;
    Patch(
    colListadoPrec;Defaults(colListadoPrec);
    {

    lstReferencia:LookUp(pr_Productos;Referencia=T1.ReferenciaE);
    cr043_precinto: T1.Precinto;)
    }
    ));;

    Collect(pr_Listado;colListadoPrec)

     

     

    Now it works.

     

    Thanks anyway.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard