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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch not allowing to ...
Power Apps
Answered

Patch not allowing to enter data into a Sharepoint List: Missing column

(2) ShareShare
ReportReport
Posted on by 6
I have the following code for submitting values from a form to a Sharepoint List with the name 'KP Tracking Target'. I built fist a variable to enter the data and the passed it to the Patch function.
 
Set(
    recordToSubmit,
    {
        'KPName': { Value: dc_KPName.Selected.Value },
        'KPDate': dc_Date.SelectedDate,
        'KPValue': Value('dc_KP Result'.Text),
        'KP_Id': KP_Id,
        OCDepartment: {Value: "OCD"},
        Location: { Value: "Paris" },
        Department: "Test",
        'PersoninCharge': {
            Claims: "i:0#.f|membership|" & varCurrentUser.Email, // Required structure
            DisplayName: varCurrentUser.FullName,
            Email: varCurrentUser.Email
        }
    }
);
 
Patch(
      'KP Tracking Target', // Replace with your SharePoint list name
       Defaults('KP Tracking Target'),
       recordToSubmit
       )
 
 
First I received following error:
 
Missing column. Your formula is missing a column 'Department' with a type of 'Text'.
 
For that reason, I included Department into the variable. After that I received following Notifications:
 
The specified column 'Department' does not exist.
Invalid argument type. Expecting a Record value, but of a different schema.
Missing column. Your formula is missing a column 'Department' with a type of 'Text'.
I do not really get, which the problem is. In the Sharepoint List there is no Department Column.
 
Does someone has any idea, what is happening there?
 
 
 
 
 
Categories:
I have the same question (0)
  • Suggested answer
    VASANTH KUMAR BALMADI Profile Picture
    266 on at

    *** ChatGPT Response to question ***

    Hi,

    The issue arises because the Department column you're trying to patch into your SharePoint list 'KP Tracking Target' does not exist in that list. When you include a column in the recordToSubmit variable that is not present in the SharePoint list, Power Apps throws an error stating that the column does not exist.

    Steps to Fix the Issue:

    1. Verify the SharePoint List Columns:

      • Go to your SharePoint list 'KP Tracking Target'.
      • Check if a column named Department exists.
      • If it doesn’t, remove the Department property from your recordToSubmit variable.
    2. Update Your Code:

      • Remove the Department property if it's not needed or create the column in the SharePoint list if you need to store the value.

      Here’s the corrected code assuming Department is not needed:

      Set(
      recordToSubmit,
      {
      'KPName': { Value: dc_KPName.Selected.Value },
      'KPDate': dc_Date.SelectedDate,
      'KPValue': Value('dc_KP Result'.Text),
      'KP_Id': KP_Id,
      OCDepartment: { Value: "OCD" },
      Location: { Value: "Paris" },
      'PersoninCharge': {
      Claims: "i:0#.f|membership|" & varCurrentUser.Email,
      DisplayName: varCurrentUser.FullName,
      Email: varCurrentUser.Email
      }
      }
      );

      Patch(
      'KP Tracking Target', // SharePoint list name
      Defaults('KP Tracking Target'),
      recordToSubmit
      );
    3. Add the Department Column (Optional):

      • If the Department column is required, add it to the SharePoint list:
        1. Go to the SharePoint list settings.
        2. Create a new column named Department.
        3. Set its type to Single line of text or another appropriate data type.
      • After adding the column, the original code with the Department property will work.
    4. Validate the Schema:

      • Ensure all column names and data types in your recordToSubmit variable match those in the SharePoint list.
      • For complex types like PersoninCharge, ensure the structure (Claims, DisplayName, Email) aligns with the SharePoint Person or Group field requirements.

    Debugging Tips:

    • Use the formula bar to check for any warnings or errors on each part of your code.
    • Temporarily comment out problematic fields and test the Patch function step-by-step.
    • Use the Monitor tool in Power Apps to debug runtime issues.
    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!
  • timl Profile Picture
    36,415 Super User 2025 Season 2 on at
     Hi GA-03010944-0
     
    Have you modified your 'KP Tracking Target' list after creating your app? The first thing I would try is to refresh this list from the data panel of the designer. Hopefully that might make a difference.
     
  • Suggested answer
    Anujjain Profile Picture
    20 on at
    Patch(
          'KP Tracking Target', // Replace with your SharePoint list name
           Defaults('KP Tracking Target'),
    {
            'KPName': { Value: dc_KPName.Selected.Value },
            'KPDate': dc_Date.SelectedDate,
            'KPValue': Value('dc_KP Result'.Text),
            'KP_Id': KP_Id,
            OCDepartment: {Value: "OCD"},
            Location: { Value: "Paris" },
            Department:{ Value: "Test"},
            'PersoninCharge': {
                Claims: "i:0#.f|membership|" & varCurrentUser.Email, // Required structure
                DisplayName: varCurrentUser.FullName,
                Email: varCurrentUser.Email
            }
        }
     
    is this working?
  • Suggested answer
    WarrenBelz Profile Picture
    153,127 Most Valuable Professional on at
    The Department field is part of the Person field structure - you also need another small adjustment (all shown in blue below)
    Patch(
       'KP Tracking Target',
       Defaults('KP Tracking Target'),
       {
          'KPName': {Value: dc_KPName.Selected.Value},
          'KPDate': dc_Date.SelectedDate,
          'KPValue': Value('dc_KP Result'.Text),
          'KP_Id': KP_Id,
          OCDepartment: {Value: "OCD"},
          Location: {Value: "Paris"},
          'PersoninCharge': 
          {
             Claims: "i:0#.f|membership|" & Lower(varCurrentUser.Email),
             Department: "",
             DisplayName: varCurrentUser.FullName,
             Email: varCurrentUser.Email,
             JobTitle: "",
             Picture: ""
          }
       }
    )
     
    Please click 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 giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn    Buy me a coffee
  • Suggested answer
    GA-03010944-0 Profile Picture
    6 on at
    Thanks @WarrenBelz, I just tried your suggestion but it didn't work. It keeps asking for the missing Department value. The weird thing is, that it keeps asking for Department even though I already created a Column with the same name in the Sharepoint list. I really thought your answer will correct the error but it didn't.
     
    Invalid argument type. Expecting a Record value, but of a different schema.
    Missing column. Your formula is missing a column 'Department' with a type of 'Text'.
  • timl Profile Picture
    36,415 Super User 2025 Season 2 on at
    GA-03010944-0
     
    As I mentioned earlier, have you refreshed the data source? If you create a brand new app and try the same formula, do you get the same error?
  • Verified answer
    WarrenBelz Profile Picture
    153,127 Most Valuable Professional on at
    OK - you might now run with @timl's suggestion - you still need Department and the other two fields in your Person patch (which is why I thought that was the issue). Also have you tried changing the field name to something else (you will need a new field)

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard