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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Set(varNewItem on OnSt...
Power Apps
Unanswered

Set(varNewItem on OnStart NavigateToNew?

(0) ShareShare
ReportReport
Posted on by 1,599 Super User 2024 Season 1

On my App, I have a form chooser gallery where if I click on the "+" icon to the right of each form, it navigates me to a new item screen.

However, if I click on the "eye/view" icon, I am taken to a gallery/list view screen where if I select a new item button in there I can set the varNewItem variable.

sudosaurus_1-1661346666963.png

What I want to do is to be able to do this on my home screen / form chooser.

 

This is the code I am using on my App OnStart property:

 

Set(
 clTheme,
 {
 clBlue: BlueSquare.Fill,
 clDarkBlue: DarkBlueSquare.Fill,
 clRed: RedSquare.Fill,
 clYellow: YellowSquare.Fill,
 clWhite: WhiteSquare.Fill,
 clGreen: GreenSquare.Fill
 }
);

Set(
 ftTheme,FontLabel.Font
);
ClearCollect(
colGalleryMenu,
{
MenuTitle: "Extra Care Application to keep a mobility scooter",
NavigateTo: ECAKMS_scrn,
NavigateToNew: ECAKMS_form_scrn
},
{
MenuTitle: "Extra Care Centra New Resident",
NavigateTo: ECCNR_scrn,
NavigateToNew: ECCNR_form_scrn
},
{
MenuTitle: "Extra Care Person Centered Fire Risk Assessment",
NavigateTo: ECPCFRA_scrn,
NavigateToNew: ECPCFRA_form_scrn
},
{
MenuTitle: "Extra Care Personal Emergency Evacuation Management Plan",
NavigateTo: ECOEEMP_scrn,
NavigateToNew: ECOEEMP_form_scrn
},
{
MenuTitle: "Older Persons Support Agreement",
NavigateTo: OPSA_scrn,
NavigateToNew: OPSA_form_scrn
},
{
MenuTitle: "Supported Housing Move Out Checklist",
NavigateTo: SHMOC_scrn,
NavigateToNew: SHMOC_form_scrn
},
{MenuTitle: "Support Plan Needs Assessment",
NavigateTo: SPNA_scrn,
NavigateToNew: SPNA_form_scrn
},
{MenuTitle: "Supported Housing Risk Assessment and Management Review",
NavigateTo: SHRAAMR_scrn,
NavigateToNew: SHRAAMR_form_scrn
},
{MenuTitle: "Support Plan",
NavigateTo: SP_scrn
}
);

 

 

Essentially I need to be able to put the "Set(varNewItem" into the "NavigateToNew" bit below:

{MenuTitle: "Support Plan Needs Assessment",
NavigateTo: SPNA_scrn,
NavigateToNew: SPNA_form_scrn

 

Any suggeestions on how to acheive this would be ace!

 

Thanks! 🙂

Categories:
I have the same question (0)
  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    Why don't you try if/ switch?

     

    Like this:

     

    Switch(

    ThisItem.MenuTitle,

    "Support Plan Needs Assessment",

    Navigate(SPNA_form_scrn),

    ...

    )

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,

    Gonçalo Nogueira

    Check my LinkedIn!

    My website!

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    @Nogueira1306 

    How would I incorporate that into the above?

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    Nogueira1306_0-1661348117439.png

     

    On property OnSelect of each one of your buttons

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,

    Gonçalo Nogueira

    Check my LinkedIn!

    My website!

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    @Nogueira1306 

    Those items are in a gallery - hence the App OnStart property and the above code..

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    In the first button you write:

     

    Switch(

    ThisItem.MenuTitle,

    "Support Plan Needs Assessment",

    Navigate(SPNA_form_scrn),

    ...

    )

     

    You need to write an option for each one of your options (suport plan, odler person, etc)

     

    Then you repeat but for the second button...

     

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    @Nogueira1306 ah OK, so the "..." is there I put the additional options right?

    and at which point do I insert this bit below? as that is a requirement to show the required fields in new/edit mode.

    as if I just navigate to that screen, the fields don't appear...

     

    Set(varNewItem,true);
    Set(varSelectedItem,Defaults('Support Plan Needs Assessment'));

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    "..." are the rest of the options.

     

    Switch(

    ThisItem.MenuTitle,

    "Support Plan Needs Assessment",

    Set(varNewItem,true);
    Set(varSelectedItem,Defaults('Support Plan Needs Assessment'));

    Navigate(SPNA_form_scrn),

    ...

    )

     

    Check if that works

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,

    Gonçalo Nogueira

    Check my LinkedIn!

    My website!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard