cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Super User III
Super User III

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

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

Super User III
Super User III

@OmniTechGuy 

Okay...what is MainScreen?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

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.

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}
)


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
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Kudoed Authors
Users online (81,042)