web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / ClearCollect inside ap...
Power Apps
Answered

ClearCollect inside app onstart is raising this error "name is not valid"

(0) ShareShare
ReportReport
Posted on by 2,057 Season of Giving Solutions 2025

i have this formula inside our canvas app onstart:-

 

ClearCollect(
 SubMenuItems,
 {
 MenuRef: 24, //MenuRef-->it maps to menu item ID
 SubMenuID: 1,
 SubMenuLbl: "KPI Dashboard", //change the submenu item label
 Screen: 'KPI Dashboard' //place the navigation screen name
 },
 {
 MenuRef: 24,
 SubMenuID: 2,
 SubMenuLbl: "Per Medium Dashboard",
 Screen:'Per Medium DashBoard'
 },
 {
 MenuRef: 24,
 SubMenuID: 3,
 SubMenuLbl: "Asset Dashboard",
 Screen: 'Assets Dashboard'
 },
 {
 MenuRef: 24,
 SubMenuID: 4,
 SubMenuLbl: "Asset Total Dashboard",
 Screen: 'Assets Total DashBoard'
 },
 {
 MenuRef: 24, //MenuRef-->it maps to menu item ID
 SubMenuID: 5,
 SubMenuLbl: "Spare Parts DashBoard", //change the submenu item label
 Screen: 'Spare Parts DashBoard', //place the navigation screen name
 },
 {
 MenuRef: 24,
 SubMenuID: 6,
 SubMenuLbl: "Per Medium Total Dashboard",
 Screen:'Spare Parts Total DashBoard'
 },
 {
 MenuRef: 24,
 SubMenuID: 7,
 SubMenuLbl: "Accidents DashBoard",
 Screen: 'Accidents DashBoard'
 },
 {
 MenuRef: 24,
 SubMenuID: 8,
 SubMenuLbl: "Printing DashBoard",
 Screen: 'Printing DashBoard'
 },
 {
 MenuRef: 24,
 SubMenuID: 9,
 SubMenuLbl: "Posting DashBoard",
 Screen: 'Posting DashBoard'
 },
 {
 MenuRef: 24,
 SubMenuID: 10,
 SubMenuLbl: "Next Day Campaign DashBoard",
 Screen: 'Next Day Campaign DashBoard'
 }
);

 

so what is wrong with my formula? that cause power apps to refuse it, as follow:-

 

 

johnjohnPter_0-1707493730606.png

 

Thanks

Categories:
I have the same question (0)
  • Verified answer
    ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    @johnjohnPter Try this:

     

    ClearCollect(
     SubMenuItems,
     Table( {
     MenuRef: 24, //MenuRef-->it maps to menu item ID
     SubMenuID: 1,
     SubMenuLbl: "KPI Dashboard", //change the submenu item label
     Screen: 'KPI Dashboard' //place the navigation screen name
     },
     {
     MenuRef: 24,
     SubMenuID: 2,
     SubMenuLbl: "Per Medium Dashboard",
     Screen:'Per Medium DashBoard'
     },
     {
     MenuRef: 24,
     SubMenuID: 3,
     SubMenuLbl: "Asset Dashboard",
     Screen: 'Assets Dashboard'
     },
     {
     MenuRef: 24,
     SubMenuID: 4,
     SubMenuLbl: "Asset Total Dashboard",
     Screen: 'Assets Total DashBoard'
     },
     {
     MenuRef: 24, //MenuRef-->it maps to menu item ID
     SubMenuID: 5,
     SubMenuLbl: "Spare Parts DashBoard", //change the submenu item label
     Screen: 'Spare Parts DashBoard', //place the navigation screen name
     },
     {
     MenuRef: 24,
     SubMenuID: 6,
     SubMenuLbl: "Per Medium Total Dashboard",
     Screen:'Spare Parts Total DashBoard'
     },
     {
     MenuRef: 24,
     SubMenuID: 7,
     SubMenuLbl: "Accidents DashBoard",
     Screen: 'Accidents DashBoard'
     },
     {
     MenuRef: 24,
     SubMenuID: 8,
     SubMenuLbl: "Printing DashBoard",
     Screen: 'Printing DashBoard'
     },
     {
     MenuRef: 24,
     SubMenuID: 9,
     SubMenuLbl: "Posting DashBoard",
     Screen: 'Posting DashBoard'
     },
     {
     MenuRef: 24,
     SubMenuID: 10,
     SubMenuLbl: "Next Day Campaign DashBoard",
     Screen: 'Next Day Campaign DashBoard'
     })
    );

     

    This is correct syntax:

     

    Table( Record1 [, Record2, ... ] )

    Record(s) - Required. The records to add to the table.


    Examples
    Set the Items property of a listbox to this formula:
    Table({Color:"red"}, {Color:"green"}, {Color:"blue"})

    Reference: https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-table

     

    -----------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍

    Thanks,
    ANB


  • ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    @johnjohnPter 

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍

    Thanks,
    ANB


Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard