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 / Patching to a newly cr...
Power Apps
Unanswered

Patching to a newly created row in a Dataverse table

(0) ShareShare
ReportReport
Posted on by 27

Hi guys,

I have been struggling a while with this problem and can't solve it or find anyone else's solution fixing my problem.

 

I have a Canvas App with dataverse.

I have the Tables Execution (CT) where I want create a new row and patch to different columns. It has a Lookup column to the related table (Requirement (CT) ).

The lookup column is called Lookup_Requirement (CT) in the Execution table and goes to the primary column called Description in the Requirement table.

I have a Gallery (Gallery4) where I have a text label (Label5) where it displays the Description from the Requirement table.

It works to create a new row and to patch text values to different columns, but I can't seem to get the lookup column or the choice column to work. I tried various different things and I don't remember all to list here.

This is my code of the latest try, where I get the error: Invalid argument type. Expecting a Record value, but of a different schema. Which I don't understand.

 

If(
    IsBlank(
        LookUp('Execution (CT)S', 'Lookup_Requirement (CT)'.Description = Gallery4.Selected.Description)
    ),
    Patch(
        'Execution (CT)S',
        Defaults('Execution (CT)S'),
        {
            Executor: "Hello",
            Controlnr: "kjk",
            'Lookup_Requirement (CT)': LookUp(Requirement (CT), Description = Lable5.Text).Description
        }
    ),
    Notify("A row for this requirement already exists.", NotificationType.Information)
);
 
I appreciate any help

 

Categories:
  • mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at

    hey @ambobo 

     

    please try this approach:

     

    If(
     IsBlank(
     LookUp('Execution (CT)S', 'Lookup_Requirement (CT)'.Description = Gallery4.Selected.Description)
     ),
     Patch(
     'Execution (CT)S',
     Defaults('Execution (CT)S'),
     {
     Executor: "Hello",
     Controlnr: "kjk",
     'Lookup_Requirement (CT)': LookUp('Requirement (CT)', Description = Gallery4.Selected.Label5.Text)
     }
     ),
     Notify("A row for this requirement already exists.", NotificationType.Information)
    );

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • ambobo Profile Picture
    27 on at

    Thank you for your response!

    I get the same issue:

    Invalid argument type. Expecting a Record value, but of a different schema.

     

    As far as I understand it, this suggests that the structure of the record does not match the expected schema of the target field. However Description is a text value, and Gallery4.Selected.Label5.Text is a text value and the lookup function retrieves a record, which is what is expected. Is it possible that I can't lookup in a different table that the patch function is patching to?
    This does also not work and gives me the same error:

     'Lookup_Requirement (CT)': LookUp('Execution (CT)S', abo_requirement = Gallery4.Selected.Label5.Text)
  • mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at

    If(
    IsBlank(
    LookUp('Execution (CT)S', 'Lookup_Requirement (CT)'.Description = Gallery4.Selected.Description)
    ),
    Patch(
    'Execution (CT)S',
    Defaults('Execution (CT)S'),
    {
    Executor: "Hello",
    Controlnr: "kjk",
    'Lookup_Requirement (CT)': LookUp('Requirement (CT)', Description = Gallery4.Selected.Label5.Text)
    }
    ),
    Notify("A row for this requirement already exists.", NotificationType.Information)
    );

     

    Try this please

  • ambobo Profile Picture
    27 on at

    This is what I tried before and that gave me the error mentioned above still.

  • mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at

    Another try

     

    If(
    IsBlank(
    LookUp('Execution (CT)S', 'Lookup_Requirement (CT)'.Description = Gallery4.Selected.Description)
    ),
    Patch(
    'Execution (CT)S',
    Defaults('Execution (CT)S'),
    {
    Executor: "Hello",
    Controlnr: "kjk",
    'Lookup_Requirement (CT)': LookUp('Requirement (CT)', Description = Gallery4.Selected.Label5.Text, ThisRecord)
    }
    ),
    Notify("A row for this requirement already exists.", NotificationType.Information)
    );

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • ambobo Profile Picture
    27 on at

    Still the same issue with your new code.

    Do you have any idea what it is refering to with the error "from a different scheme"?

  • jrletner Profile Picture
    720 Moderator on at

    The error message suggests that there is an issue with the schema of the record you are trying to create or update. The PATCH function expects a record value that matches the schema of the target data source. 

    You can check the schema of the 'Execution (CT)S' and ensure that it matches the schema of the record you are trying to create or update. Be sure to check the data types of the columns in the data source and ensure that they match the expected data types.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard