cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
chrisog
Level 8

Collection not collecting

Hi,

 

One of my collections refuses to collect when used on mobile phones. I have tested the issue multiple times in the Powerapps Studio and on phones and it only happens on phones. 

 

I have the user fill out a form and when they press a button, it collects that information to a local collection and navigates them to the next screen which shows the information they submitted. Up until today this worked perfectly. This morning it stopped working and now the collection is always empty no matter how I try to do it. This isn't true when I go through the exact same process on pc though. The pc works perfectly and I can check my collection is populating. Any ideas why this might happen and what I could do to fix it?

1 ACCEPTED SOLUTION

Accepted Solutions
chrisog
Level 8

Re: Collection not collecting

Apparently I have solved it! It was being caused by a value not being passed by a component properly and passing an error instead!

I would never have figured it out without looking more in depth at how the date values were being passed as it was a calendar component so thank you!

View solution in original post

6 REPLIES 6
Dual Super User
Dual Super User

Re: Collection not collecting

How big is the collection?  If this is a really large collection you might be hitting a memory limit issue.



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

Re: Collection not collecting

This is my collect formula:

 

Collect(
OrderNumber,
{
idordernum: If(IsEmpty(OrderNumber),1,Max(OrderNumber,idordernum)+1),
dateOrder:Today(),
ordernum: 0,
supplier: DataCardValue31.Text,
jobnum: JobNumInput.Text,
jobname:JobNameInput.Text,
quantity: Value(OFItemNum.Text),
itemname: OFItemName.Text,
isHire: Value(OF1HB.Text),
dateOnhire: If(HB1.Value,DateValue(Text(_onhire))),
dateOffhire: If(HB1.Value,DateValue(Text(_offhire))),
Title: If(IsEmpty(LoginDetails),"",First(LoginDetails).Username),
userOnBehalf:If(OboCheckbox.Value,Dropdown1.SelectedText.Value,First(LoginDetails).Username),
isDelivery: Value(DataCardValue40.Text),
address1: DataCardValue41.Text,
address2: DataCardValue42.Text,
address3: DataCardValue43.Text,
postcode: DataCardValue44.Text,
dateDelivery: DateValue(Text(_delivery)),
contactnum:TextInput5.Text

}
);
Set(jnumlookup2,jnumlookup1);Set(jnamelookup2,jnamelookup1);UpdateContext({hire:false,_onhire:Blank(),_offhire:Blank()});Reset(Calendar_1);
ResetForm(OFItem)

 

 

The collection itself always starts as blank and they might add up to 10 rows. I have tested taking out the resetform to see if that is somehow triggering before the collect works but it does nothing. 

Dual Super User
Dual Super User

Re: Collection not collecting

So are you saying that the collection is never created or that at some point it stops adding records?  It doesn't look like an individual record would be that large, but you still might be hitting a memory limit if you add multiples.  It would also be dependent on what else you are adding to memory in the app in terms of graphics etc.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Dual Super User
Dual Super User

Re: Collection not collecting

Hey @chrisog 

 

Can you try to update the expression as:
 
Collect(
OrderNumber,
{
idordernum: If(IsEmpty(OrderNumber),1,Max(OrderNumber,idordernum)+1),
dateOrder: DateValue(Text(Today(),"mm/dd/yyyy")),
ordernum: 0,
supplier: DataCardValue31.Text,
jobnum: JobNumInput.Text,
jobname:JobNameInput.Text,
quantity: Value(OFItemNum.Text),
itemname: OFItemName.Text,
isHire: Value(OF1HB.Text),
dateOnhire: If(HB1.Value,DateValue(Text(_onhire,"mm/dd/yyyy"))),
dateOffhire: If(HB1.Value,DateValue(Text(_offhire,"mm/dd/yyyy"))),
Title: If(IsEmpty(LoginDetails),"",First(LoginDetails).Username),
userOnBehalf:If(OboCheckbox.Value,Dropdown1.SelectedText.Value,First(LoginDetails).Username),
isDelivery: Value(DataCardValue40.Text),
address1: DataCardValue41.Text,
address2: DataCardValue42.Text,
address3: DataCardValue43.Text,
postcode: DataCardValue44.Text,
dateDelivery: DateValue(Text(_delivery,"mm/dd/yyyy")),
contactnum:TextInput5.Text
 
}
);
Set(jnumlookup2,jnumlookup1);Set(jnamelookup2,jnamelookup1);UpdateContext({hire:false,_onhire:Blank(),_offhire:Blank()});Reset(Calendar_1);
ResetForm(OFItem)
 
The format of returning date in a mobile might be different than PC so it would be better to perform a operation on the data.
 
Also, can you create a temporary label to check if there is any data in the collection.
 
Use the below expression on the text property of the label: CountRows(CollectionName)
 
Hope this helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
chrisog
Level 8

Re: Collection not collecting

Thanks for the replies.

 

As far as memory in the app, I only have 2 very small (60kb) graphics and it is all fairly simple. The collections used to work - I did move over my data source from mySQL to Sharepoint last week (Tuesday) but everything was working perfectly until this morning. 

 

I changed the format of my dates as suggested but this did nothing. It seems to perform the resetform instantly but even if I remove it there is no data in the collection.

chrisog
Level 8

Re: Collection not collecting

Apparently I have solved it! It was being caused by a value not being passed by a component properly and passing an error instead!

I would never have figured it out without looking more in depth at how the date values were being passed as it was a calendar component so thank you!

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,439)