cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
priyankbhat
Level: Powered On

Patch is giving Objnull error

Hi,

 

I have created a timesheet app using powerapps and sharepoint. Recently came accross limitation with sharepoint which does not allow to view list which has more than 4k records. Powerapps also fail to pull records more than 4k. App is used by approximately 200 people. 

 

Finally after lot of research and few youtube videos i was able to comeup with solution on working with CSV file that will be stored on sharepoint. Working with CSV file is limitation with in powerapps.  Conceptually my app creates monthly CSV file for 200 people and store it on sharepoint and is able to dynamically pull it using MsFlow. Overall on sharepoint i will have 200*12=2400 csv file in 1 year. 

 

Initially for POC I created a test app with only 1 month data. App pulls csv file and converts into collection object. App has editable grid (using labels, textbox, dropdowns, calender control and gallery controls). Onchange event of each control I was able to patch collection current row & cells (based on thisitem in gallery control) with data for related column.

 

I have extended same functionality in app to pull all 12 monthly files into memory and only display selected month data in editable grid (created using labels, textbox and gallery controls). Pulling and showing data is working absolutely fine. 

 

Below code worked fine.

Patch(CSVData, ThisItem, {reportingdate:TextInput2_5.Text, updatedon:Text(Now(),"[$-en-US]mm/dd/yyyy")});

 

Modified code

Patch(Switch(Dropdown1_1.SelectedText.Value, "Jan", JanData, "Feb", FebData, "Mar", MarData, "Apr", AprData, 
"May", MayData, "Jun", JunData, "Jul", JulData, "Aug", AugData, "Sep", SepData, "Oct", OctData, "Nov", NovData,
"Dec", DecData), ThisItem, {reportingdate:TextInput2_5.Text, updatedon:Text(Now(),"[$-en-US]m/d/yyyy")});

 

Even if I replace it with 1 collection. I am now getting same error as per attachment.

 

Below is code used for initializing collection structure.

ClearCollect(JanData,{id:"*", reportingdate:Blank(), accountname:Blank(), highlevelscope:Blank(), Activity:Blank(), 
Duration:Blank(), billingcode:Blank(), comments:Blank(), wk:Blank(), updatedon:Blank()});

Please suggest how to fix ObjNull error.

 

Thanks

Priyank Bhat

 

1 ACCEPTED SOLUTION

Accepted Solutions
priyankbhat
Level: Powered On

Re: Patch is giving Objnull error

Hi,

 

I found issue was with type casting. Column in custom collection was marked as date column and converstion of text to date was not working after data was reloaded from string/text.

 

Alternatively i saved column as numeric value using

Value(DatePicker1.SelectedDate)

or

Value(Now())

this returned long numeric value.

 

For converting this long numeric value back to date i used below command

DateValue(LongNumericValue)

Solution worked for me and i am no more getting Objnull error.

 

Priyank Bhat

View solution in original post

4 REPLIES 4
Dual Super User
Dual Super User

Re: Patch is giving Objnull error

Neither PowerApps or SharePoint have a limitation on how many records can be stored in a list.  They do have a limitation on how many records can be retrieved from a list.  For PowerApps that limit by default is 500.  It can be increased to 2,000 if necessary.  But the key is to Filter the list using a function that supports delegation so you aren't pulling all the records in the list.  What formula are you using to retreive the records?  Because simply switching to a CSV file isn't going to help in the long run.  You need to make sure that you aren't trying to get every record in the list.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
priyankbhat
Level: Powered On

Re: Patch is giving Objnull error

Hi,

 

I found issue was with type casting. Column in custom collection was marked as date column and converstion of text to date was not working after data was reloaded from string/text.

 

Alternatively i saved column as numeric value using

Value(DatePicker1.SelectedDate)

or

Value(Now())

this returned long numeric value.

 

For converting this long numeric value back to date i used below command

DateValue(LongNumericValue)

Solution worked for me and i am no more getting Objnull error.

 

Priyank Bhat

View solution in original post

tested1
Level: Powered On

Re: Patch is giving Objnull error

Hello,

 

Is there any chance I could see an image of how your timesheet app looks?/ PM me it? Just looking for some inspiration 🙂 Thanks

Highlighted
priyankbhat
Level: Powered On

Re: Patch is giving Objnull error

@tested1 ,

 

Find below screen

timeentry.PNG

 

Thanks

Priyank

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 326 members 6,022 guests
Please welcome our newest community members: