cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
N0rPa
Regular Visitor

Problem building collection after defining variable in startup

Hi i am having an issue with defining a collection after building objects in startup

 

i think this is a syntax issue but i may be out my depth..

 

in my app OnStart

 

i populate these objects using the connectors

 

Set(
varUser,
{
myProfile: Office365Users.MyProfileV2(),
directReports: Office365Users.DirectReportsV2(User().Email),
myManager: Office365Users.ManagerV2(User().Email)
}
)

 

and i want to add a collection to this aswell to populate my browse gallery navigation.

 

ClearCollect( NaviItems, Table( { Label: "All Leave", Screen: AllLeave }, { Label: "MyLeave", Screen: MyLeave}, { Label: "Today", Screen: TodayLeave} ) )

 

every time i try to add this it fails any ideas?

 

Regards

 

Neil.

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@N0rPa 

Do you see any errors in the app checker?  If yes, please share the error message.

 

Make sure to put a semi-colon at the end of your SET function to tell Power Apps its an end-of-line.

 

Set(
    varUser,
    {
        myProfile: Office365Users.MyProfileV2(),
        directReports: Office365Users.DirectReportsV2(User().Email),
        myManager: Office365Users.ManagerV2(User().Email)
    }
);

ClearCollect( NaviItems, Table( { Label: "All Leave", Screen: AllLeave }, { Label: "MyLeave", Screen: MyLeave}, { Label: "Today", Screen: TodayLeave} ) )

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

3 REPLIES 3
mdevaney
Super User
Super User

@N0rPa 

Do you see any errors in the app checker?  If yes, please share the error message.

 

Make sure to put a semi-colon at the end of your SET function to tell Power Apps its an end-of-line.

 

Set(
    varUser,
    {
        myProfile: Office365Users.MyProfileV2(),
        directReports: Office365Users.DirectReportsV2(User().Email),
        myManager: Office365Users.ManagerV2(User().Email)
    }
);

ClearCollect( NaviItems, Table( { Label: "All Leave", Screen: AllLeave }, { Label: "MyLeave", Screen: MyLeave}, { Label: "Today", Screen: TodayLeave} ) )

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

VineetBhasin
Frequent Visitor

Syntax seems to be correct. Please ensure that all screens exists. In the attached file only 'AllLeave' screen is visible.

 

You can click on 'App Checker' to view error detail.

 

N0rPa
Regular Visitor

Thanks perfect.

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

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

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (2,307)