Hi
1. Check Column Naming Consistency
The error you’re seeing suggests that PowerApps might not be recognizing the column correctly. SharePoint column names can sometimes behave oddly in PowerApps, especially if they were renamed at some point. Here’s what you can try:
-
Verify Internal Name: Go to SharePoint, click on the column settings in "List settings" > "Column settings," and ensure that the internal column name is NotesAdded. The display name might differ from the internal name, especially if the column name was renamed after creation.
-
Re-add the List as a Data Source: You mentioned reconnecting to the data source, but try removing the data source entirely from PowerApps, saving and closing the app, then reopening it and re-adding the data source to ensure PowerApps refreshes the schema.
2. Use Exact Column Names in Patch Function
Ensure that column names in your recordToSubmit object exactly match the column names in SharePoint. This can sometimes require trial and error with the internal names. Here’s a way to modify your Patch function to confirm:
Patch(
'C Priority Lists',
Defaults('C Priority Lists'), // Ensure there is no typo or extra space in the list name
{
TimeRaised: DateValue(First(SortedDates).DateTime) + TimeValue(First(SortedDates).DateTime),
TimeAssigned: DateValue(Last(FirstN(SortedDates, 2)).DateTime) + TimeValue(Last(FirstN(SortedDates, 2)).DateTime),
TimeStarted: DateValue(Last(FirstN(SortedDates, 3)).DateTime) + TimeValue(Last(FirstN(SortedDates, 3)).DateTime),
NotesAdded: DateValue(Last(FirstN(SortedDates, 4)).DateTime) + TimeValue(Last(FirstN(SortedDates, 4)).DateTime),
TimeCompleted: DateValue(Last(SortedDates).DateTime) + TimeValue(Last(SortedDates).DateTime)
}
);
Note: Confirm that 'C Priority Lists' is exactly how the list is named in PowerApps, including spaces, as even minor discrepancies can cause issues.
3. Remove and Recreate the Column (If Feasible)
If renaming and re-verifying do not resolve the issue, you might try deleting and recreating the NotesAdded column in the SharePoint list if feasible. This approach helps if there’s a deeper issue with how the column metadata is handled.
4. Confirm Data Types
Ensure that the NotesAdded column in SharePoint is set to accept Date/Time values if that’s the expected data type. PowerApps can sometimes throw errors if there’s a type mismatch between PowerApps and SharePoint.
5. Test with Minimal Patch to Isolate the Issue
To further isolate, try submitting only the NotesAdded field to SharePoint and see if it patches without errors. This test can help confirm if the issue lies specifically with that column or with the overall recordToSubmit.
Patch(
'C Priority Lists',
Defaults('C Priority Lists'),
{
NotesAdded: DateValue(Last(FirstN(SortedDates, 4)).DateTime) + TimeValue(Last(FirstN(SortedDates, 4)).DateTime)
}
);
6. Check PowerApps Naming Conflicts
In some cases, PowerApps can have caching issues with old column names or fields that share similar names. If possible, rename the NotesAdded column in SharePoint to something unique (like NotesDateAdded), update the recordToSubmit formula accordingly, and test again.
7. Log Output for Debugging
To get more insights, you could set a label or Notify function to display the exact name that PowerApps is recognizing, which can help debug issues with naming.
Notify("Detected column: " & Text('C Priority Lists'.NotesAdded), NotificationType.Information);
Final Check
After making these adjustments, test the button to see if the error persists. If it does, PowerApps may not be recognizing the updated schema for some reason, and further steps like recreating the form or using alternative approaches might be needed.
Let me know if any of these suggestions solve the issue or if more troubleshooting is required!