cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
LJ
Level: Powered On

IF/NewForm Formula not working

Hello,

 

I have a formula that isn't working (shows the red x error symbol) and I haven't been able to figure out how to fix it. I'm trying create & navigate to one of two new forms, using the IF formula to specify which form to create and naviate to:

 

If(DDCreateType.Selected.Value = "Single Item", (NewForm(FormSingleItemEdit); Navigate(SingleItemEdit,ScreenTransition.None), (NewForm(FormRecurringEdit); Navigate(RecurringEdit,ScreenTransition.None)))

 

  • My dropdown (DDCreateType) has two options: "Single Item" and "Recurring"
  • There are two forms: FormSingleItemEdit (on the SingleItemEdit screen) and FormRecurringEdit (on the RecurringEdit screen

 

Note: when I take away the NewForm portion of the formula (see below), the button successfully navigates to the appropriate screens.

 

If(DDCreateType.Selected.Value = "Single Item", Navigate(SingleItemEdit,ScreenTransition.None), Navigate(RecurringEdit,ScreenTransition.None))

 

Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: IF/NewForm Formula not working

Hi @LJ,

Could you please share a bit more about the error message within your app?

Based on the formula that you provided, I think there is something wrong with the syntax of your formula.

Please modify your formula as below:

If(
    DDCreateType.Selected.Value = "Single Item",
    NewForm(FormSingleItemEdit); Navigate(SingleItemEdit,ScreenTransition.None),
    NewForm(FormRecurringEdit); Navigate(RecurringEdit,ScreenTransition.None)
)

Or

If(
    DDCreateType.Selected.Value = "Single Item",
    NewForm(FormSingleItemEdit); Navigate(SingleItemEdit,ScreenTransition.None),
    DDCreateType.Selected.Value = "Recurring",
    NewForm(FormRecurringEdit); Navigate(RecurringEdit,ScreenTransition.None)
)

then check if the issue is solved.

 

More details about the If function in PowerApps, please check the following article:

If function

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: IF/NewForm Formula not working

I believe you have an unbalanced number of parenthesis in your expression, and it is making the expression parsing fail. If you replace it with the expression below it should work.

If(
    DDCreateType.Selected.Value = "Single Item",
    NewForm(FormSingleItemEdit); Navigate(SingleItemEdit,ScreenTransition.None),
    NewForm(FormRecurringEdit); Navigate(RecurringEdit,ScreenTransition.None))
Community Support Team
Community Support Team

Re: IF/NewForm Formula not working

Hi @LJ,

Could you please share a bit more about the error message within your app?

Based on the formula that you provided, I think there is something wrong with the syntax of your formula.

Please modify your formula as below:

If(
    DDCreateType.Selected.Value = "Single Item",
    NewForm(FormSingleItemEdit); Navigate(SingleItemEdit,ScreenTransition.None),
    NewForm(FormRecurringEdit); Navigate(RecurringEdit,ScreenTransition.None)
)

Or

If(
    DDCreateType.Selected.Value = "Single Item",
    NewForm(FormSingleItemEdit); Navigate(SingleItemEdit,ScreenTransition.None),
    DDCreateType.Selected.Value = "Recurring",
    NewForm(FormRecurringEdit); Navigate(RecurringEdit,ScreenTransition.None)
)

then check if the issue is solved.

 

More details about the If function in PowerApps, please check the following article:

If function

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,252)