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 Apps
Answered

Error code in app.

(1) ShareShare
ReportReport
Posted on by 14
Creating an app for a school in which there is a screen which adds students to a sharepoint list. The list has two columns: Title and Class, Title being the name of the student.  My code didn't give any errors however when i tried to make an entry it did "Students failed: Object must implement IConvertible.
clientRequestId: 497f83b6-5149-4ae1-8346-07a10544d656
serviceRequestId: aecefda1-20f9-f000-d0ef-6c5c255492a7". The code i used is the following:
 
If(
    IsBlank(txtStudentName) || IsBlank(cmbStudentClass.Selected),
    Notify("❌ Please enter student name and select a class.", NotificationType.Error),
 
    Patch(
        Students,
        Defaults(Students),
        {
            Title: txtStudentName,
            Class: {
                '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
                Id: cmbStudentClass.Selected.ID,
                Value: cmbStudentClass.Selected.Title
            }
        }
    );
 
    Notify("✅ Student added successfully!", NotificationType.Success);
    Reset(txtStudentName);
    Reset(cmbStudentClass)
)
Categories:
I have the same question (0)
  • Verified answer
    Fredrik_A Profile Picture
    3,644 Super User 2026 Season 1 on at
    Hello,
     
    try this:
     
    If(
        IsBlank(txtStudentName.Text) || IsBlank(cmbStudentClass.Selected),
        Notify("❌ Please enter student name and select a class.", NotificationType.Error),
     
        Patch(
            Students,
            Defaults(Students),
            {
                Title: txtStudentName.Text,
                Class: {
                    '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
                    Id: cmbStudentClass.Selected.ID,
                    Value: cmbStudentClass.Selected.Title
                }
            }
        );
     
        Notify("✅ Student added successfully!", NotificationType.Success);
        Reset(txtStudentName);
        Reset(cmbStudentClass)
    )
    You are passing the entire textinput control to SharePoint which is why its complaining. You need to specify the value/text =)
     
    If my response solved your issue, please mark it as ✅ Accepted Answer and give it a like.
  • Ahmad Ali Profile Picture
    14 on at
    Thank you Fredrik. I thought the problem was with the class problem and was focusing on it. I later understood that it was the text field making the error. Your solution is correct.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard