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

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

@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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (61,930)