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 / Invalid Argument type ...
Power Apps
Unanswered

Invalid Argument type (Control). Expecting a record value instead. For a patch function linked to a sharepoint list.

(0) ShareShare
ReportReport
Posted on by 8

Sorry if this is the wrong thread, I'm new here.

I'm new to PowerApps and piecing it together through videos online. I'm attempting to make a self-assessment phone app for covid-19 that records the data input and patches it into the SharePoint list linked to the PowerApps, and I keep getting the error above. It's unclear to me what specifically it's looking for. 

My current patch function looks like this:
Patch('Covid Self Assessment Test',MainScreen,{Names:CBNames,Temperature:TempInput,Date:Now(),Symptoms: Symptom_Toggle,Exposure:Exposure_Toggle,RecentTravel:Travel_Toggle})

Names, Temperature, Date, Symptoms, Exposure, and RecentTravel are all column names in my SharePoint list. Can one even collect and patch the results of a toggle switch over to a SharePoint yes/no column?

Attached is exactly what it looks like so far. Any suggestions on how to get it to work?

Capture.PNG
Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @OmniTechGuy 

    In your formula, you are referencing the Control and not the actual value.

    Consider the following change (you might need to alter based on your actual controls):

    Patch('Covid Self Assessment Test',
     MainScreen,
     {Names:CBNames.Text,
     Temperature:TempInput.Text,
     Date:Now(),
     Symptoms: Symptom_Toggle.Value,
     Exposure:Exposure_Toggle.Value,
     RecentTravel:Travel_Toggle.Value
     }
    )

     

    I hope this is helpful for you.

  • OmniTechGuy Profile Picture
    8 on at

    Unfortunately that didn't work. It still gives the same error that there's an invalid argument type (Control) and it's expecting a record value instead. I understand what you meant about it not having a value comparing your suggestion to mine now, but now that everything seems to have a value, I can't see why it says it still needs one.

    Thanks for the help so far

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @OmniTechGuy 

    Okay...what is MainScreen?

  • OmniTechGuy Profile Picture
    8 on at

    Apologies for the very late reply, I only have powerapps at the workplace right now.

    MainScreen is the screen all the values are found. I was trying to follow a video, and in it they used the ThisItem function instead. That didn't seem to work for me (and still doesn't), so I've tried MainScreen in attempt to direct Powerapps to where the data is.

  • OmniTechGuy Profile Picture
    8 on at

    An update. I've done some fiddling with it and mostly got it to work. It seems I had renamed the title in the Sharepoint list, but Sharepoint still saw it as Title. But now a new problem occurs. You can start typing into the combobox and it will search out the name of the person you're typing. Great. Thing is, it only counts what's been typed, not the name you choose once it pops up. I've tried the function with .Text, but it gives me an error.

    Here's the updated code I'm now using and that patches, but will only patch the searched text, because it won't give me any other usable choice I can find.
    Patch('Covid Self Assessment Test',
    Defaults('Covid Self Assessment Test'),
    {Title:CBNames.SearchText,
    Temperature:TempInput.Text,
    Date:Now(),
    Symptoms:Symptom_Toggle.Value,
    Exposure:Exposure_Toggle.Value,
    RecentTravel:Travel_Toggle.Value}
    )


  • OmniTechGuy Profile Picture
    8 on at

    I figured out the formula. Now everything seems to be patching everything properly.

    Formula was:
    Patch('Covid Self Assessment Test',
    Defaults('Covid Self Assessment Test'),
    {Title:Concat(CBNames.SelectedItems,Names),
    Temperature:TempInput.Text,
    Date:Now(),
    Symptoms:Symptom_Toggle.Value,
    Exposure:Exposure_Toggle.Value,
    RecentTravel:Travel_Toggle.Value
    }
    )

    Thanks for the help on the values and text information from before.

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 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard