cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JDanielSolis
Helper I
Helper I

Error in collections in App On Start

Hello there,

 I have a collection in App On Start event, but I would like other collection but I get error:

For example this is my first collection:

 

 

 

ClearCollect(varColMenu;{Title:"All"};{Title:"AST"};{Title:"Completed"};{Title:"Cancelled"};{Title:"In Progress"};{Title:"New"}),
Set (varMenuSelected;""),

 

 

 

I try to add this var to my collection but it doesn't build, I tried to put a comma and semicolon at the end of my first collection but it tells me there is an error, it says there are some invalid arguments.

 

How can fix this error?

 

Tnks

 

DS

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @JDanielSolis ,

 

Because you are using a semicolon instead of a comma then you should add second semicolon at the end of the ClearCollect to continue with another action.

 

Try:

 

ClearCollect(varColMenu;{Title:"All"};{Title:"AST"};{Title:"Completed"};{Title:"Cancelled"};{Title:"In Progress"};{Title:"New"});;
Set(varMenuSelected;"")

 

View solution in original post

24 REPLIES 24
Himanshu_90677
Super User
Super User

ClearCollect(varColMenu, 

{Title:"All"},

{Title:"AST"},

{Title:"Completed"},

{Title:"Cancelled"},

{Title:"In Progress"},

{Title:"New"}

);

The error persist:

ErrorColl.jpg

Remove Var

ClearCollect( ColMenu, 

{Title: "All"},

{Title: "AST"},

{Title: "Completed"},

{Title: "Cancelled"},

{Title: "In Progress"},

{Title: "New"}

);

 
surajkv
Helper II
Helper II

Hello @JDanielSolis ,

Can you try below formula


ClearCollect(varColMenu{Title:"All"},{Title:"AST"},{Title:"Completed"},{Title:"Cancelled"},{Title:"In Progress"},{Title:"New"});

Is not working the error persist:

 

Himashu.jpg

 

 

Hello @surajkv @Himanshu_90677 

My first collection is working like this:

ClearCollect(varColMenu;
{Title:"All"};
{Title:"AST"};
{Title:"Completed"};
{Title:"Cancelled"};
{Title:"In Progress"};
{Title:"New"}
)

 

The code does not recognize me, I see that the problem is in the delimiters, comma or semicolon

 

For example, if I add this variable then the previous collection no longer recognizes it for me:

 

ErrorPower.jpg

But I've been doing some research and haven't been able to find a solution for this.

Danny_Power365
New Member

Hello @JDanielSolis  & All,

I have tested this in a fresh Canvas App - please see below. You can see there is no error for both the Clear Collect and the Variable. If your Canvas app is embedded into a model-driven app, I do know from recent projects - the "On Start" function with Collections has been problematic - the solution I have found is to add a timer and the collection is collected at the end time.

Alternatively, create a brand new app, then copy and paste the ClearCollect to "On Start" to see if it works for you.

It could be an app issue.

Danny_Power365_0-1660747638333.png

 

For example, if I replace the semicolon with commas, now the error is in the varColMenu as you can see below:

ErrorPowerII.jpg

Danny_Power365
New Member

Have you tried it in a brand-new app?

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (3,860)