cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
leyburn19
Level 10

Re: ClearCollect OnStart

Why are you using ClearCollect on start.  On Start is only used when an App is started so teh collection will have no data anyway.  I think you should just use Collect.  Clear collect would be needed at any subsequent referenc to the collection

jehrenfeld
Level: Powered On

Re: ClearCollect OnStart

Thanks for the tip. However, that doesn’t solve the problem.
PowerApps Staff AllenKim
PowerApps Staff

Re: ClearCollect OnStart

@jehrenfeld Is your database using SQL Online or SQL OnPremises? I'm not even sure that it matters, but want to take note.

 

The main difference I see between what I did and what you are trying to do is that I did not have the conditional rule. I just put a call directly to 'ClearCollect(...)' in the Screen's OnStart rule. I should also note that PowerApps informs me of an error when I try to use the ClearCollect function in the conditional rule as an action. PowerApps gives me the error saying "Function 'ClearCollect' is not supported by Rules Panel". Can you try just calling the ClearCollect functions without the 'IsBlank' conditional? You shouldn't need the 'IsBlank' conditional since you're clearing the collection first with ClearCollect anyways.

 

If removing the conditional doesn't work, can you try just making one ClearCollect call instead of all 4? I'm just trying to simplify the problem to see what could possibly be the issue. Thanks.

jehrenfeld
Level: Powered On

Re: ClearCollect OnStart

My gateway stoped working so I had to install it on another server. After I did that and reset my connection to use the new Gateway the data is now loading OnStart.

levijohnson
Level: Powered On

Re: ClearCollect OnStart

Invaluable information. That is so silly that they don't do that. 

nickduxfield
Level 8

Re: ClearCollect OnStart

I'm able to collect 1 collection from multiple data sources for use in the app using the on start.
The code makes use of the for all function together with other functions to shape data into my main collection. It works like a charm. No issues at all.

If you need assistance, give us a bell. I'm familiar with shapepoint syntax.
DTreg1
Level 8

Re: ClearCollect OnStart

Hello @AllenKim,

 

Continuing this thread, I have an app that I have set the OnStart to;

     

ClearCollect(Test,Filter('[SQL OnPrem DB Table]', DELETED="N"))

 

but I'm receiving an odd error. The error is stating that the requested operation is invalid. The column 'Test' of the table wasn't found. inner exception: The column 'Test' of the table wasn't found.

 

First, there isn't a column in my table called 'Test'. Why is the app trying to find that as a column name? That is only the name of the collection i'm trying to create. When I remove the clear collect, the error goes away but that doesn't solve my issue. I created a new trial app with just the clearcollect, a gallery and a view form and everything worked perfectly.

 

What might be the issue as to why I would be receiving an error like this, what is the app trying to do that it thinks the table has a column name the same as the collection name?

 

I really don't want to create a whole new app if I don't have to but unfortunately that's what it's looking like at the moment...

 

Any help would be greatly appreciated.

 

Thank you

DTreg1
Level 8

Re: ClearCollect OnStart

@AllenKim@jehrenfeld

 

I found the issue. I started to think if I had added any experiemental features to the app so I checked against a standard app and sure enough, in the experimental features, I had "Control property optimization" set to On (default is Off). When I turned this off and reloaded the app, it worked correctly without the error.

 

Jehrenfeld,

 

Check to see if you turned any experimental features on, this may be causing the issue. To turn them back to default, just create a new app and check how it's setup initially.

 

Hope this helps...

PowerApps Staff AllenKim
PowerApps Staff

Re: ClearCollect OnStart

Thank you for following-up on this and sharing your findings, @DTreg1. Much appreciated!

PytByt
Level: Powered On

Re: ClearCollect OnStart


@nickduxfield wrote:
I'm able to collect 1 collection from multiple data sources for use in the app using the on start.
The code makes use of the for all function together with other functions to shape data into my main collection. It works like a charm. No issues at all.

If you need assistance, give us a bell. I'm familiar with shapepoint syntax.

Hi @nickduxfield 

 

could you help me out with my case here

i really need help with collection thingy.

 

thanks,

pytbyt

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 48 members 4,320 guests
Please welcome our newest community members: