We are trying to insert a record into a SharePoint list by using Collect(ListName, Item). However, we are getting the following error:
The type Text is invalid for column 'Author'; Record expected.
When we try to add an Author value using User().Property into the Collect method we get the same error.
We have tested using static text and this adds to the SarePoint list without issue.
The collect function cashes the data locally I thought, this wouldn't be needed to do what you want to achieve.
To insert a record in a SP list you would have to have a SP list you're connected to and use a form to submit the data you want to said list
Sorry what do you mean by caches locally? You can use Collect to store local variables or create SharePoint list items.
The problem is there are multiple screens where the user can input data so we have multiple Forms and we aren't exactly sure to why our code isn't working.
I don't quite understand why you use the collect function if you only want to insert record to sharepoint list. You can just simple use the SP data to let PowerApps create the app for you and then you would be able to use this app to update your SP list.
Of course if you got your reason to do that, you are welcomed to explain it.
I was trying to use collect as it was suggested by another staff member (http://prntscr.com/dge7d0). Even then it does not explain why you can input static text into collect but not variables that essentially contain static text.. If you create a record with static text then update it using patch and variables it works so to me it seems like a bug.
We have data spread out across many screens that relates to a single record. Having a form on every screen was very slow so we decided to have a single button at the end to submit the data which was intended to follow the style of the template PowerApps.
We had to hide a form at the end and pull the data from the other screens into that form to submit but this isn't an ideal solution. Do you have any suggestions as going forward we would like to do things in the proper way.
From the error message, it seems that the problem here is that there is a mismatch between the type of the column you're updating and the data you're using to update it.
Can you share a screenshot of a simple screen that shows the error happening?
Hi, yes; that does seem to be the problem. The SharePoint list we have has no mandatory author field
I no longer have the app and currently cannot login to PowerApps (web version) http://prntscr.com/dgsv7k but I can show you the list columns - http://prntscr.com/dgsy84 . I've looked in the list and there is no Author column, we've had two other people check. If we try putting in Text/User().name(etc) into Author it'll say a record type is expected if I recall correctly. The list itself has a Author property.
Fill out a quick form to claim your user group badge now!
Find out where you can attend!
Features releasing from October 2019 through March 2020
The largest Power BI, Power Platform, and Data conference in New Zealand