Generated powerapp from sharepoint list. Creating a new entry works fine but the few fields (two Choice, one date and one Number) that have default values in SP have no initialised value. I can set the default value of the number field directly and Today() for the date in Powerapp (not ideal as that duplicates the SP logic) but I can't put a text value in for lookup fields (The property expects record values, but this rule produces incompatible [Text|Number] values.)
Is there a way to get the SP defaults as would be expected?
Lookup fields are actually record (complex) values in PowerApps. You can think of them as partial rows from a second/foreign list, with as many values as needed to uniquely identify the target row(s). To see what those record values could/should be, please collect a row of data from your SP list into a collection, and inspect that collection's schema in the Collections tab.
The NewForm() function is supposed to use the defaults values... and it appears to be doing so - however ...
The only default value set in the SharePoint list that comes through onto a new form are those with static values: a number or text. The Choice field values do not appear. BUT, these default values do come through when the record is saved. It allows a work around that by taking off the 'required' flag in SharePoint I can have the app fill in the defaults on save - but it's not ideal as I'd like them displayed on loading the new form.