New to powerapps, I am trying to load user settings from a sharepoint list on app load. If there is no record, then it should create the row in the list.
Sharepoint list (fields are single line unless sated):
Title, Email, DarkMode (Y/N), Theme
I have tried the following in OnStart on the App, but it is telling me there’s an error with the Collect.
Any help is appreciated.
Set('UserSettings', {});
Collect(UserSettings,
If(
IsBlankOrError(LookUp('SharepointListName', Email=User().Email)),
LookUp('IntegrationReporting-UserSettings', Email=User().Email),
{Title:"", Email:User().Email, DarkMode: false, Theme: "Green"}
)
)