cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
OmniTechGuy
Regular Visitor

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

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?

6 REPLIES 6
RandyHayes
Super User
Super User

@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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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
Super User
Super User

@OmniTechGuy 

Okay...what is MainScreen?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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
Regular Visitor

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
Regular Visitor

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.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (1,623)