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

Conditional statement working only SOMETIMES

Hey all, 
So I have a powerApp that:

If(CurrentUser.FullName in '[dbo].[PAR_Comments_Submission]'.User_Submitted,Exit(true), SubmitForm(Form1))

Basically
 - On a timer end 
 - Takes the users fullname 
 - Checks if it is already in the database
 - If it is the app exits
 - If it isnt submits a form 

The problem is this only works SOMETIMES
Sometimes the app exits when the users detials are already in the database  (as inteneded) 
Other times it will still stubmit the form even though the data is already there

Any help appreciated,
Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Conditional statement working only SOMETIMES

Hi @Connor_Taylor,

One reason that the function only works part time could be due to delegation issues related to the “in”  function which is not delegatable.  Instead please try a combination of IsBlank() and Lookup() to test for inclusion. Lookup() is a delegatable function.

View solution in original post

3 REPLIES 3
Highlighted
Super User
Super User

Re: Conditional statement working only SOMETIMES

Hi @Connor_Taylor,

One reason that the function only works part time could be due to delegation issues related to the “in”  function which is not delegatable.  Instead please try a combination of IsBlank() and Lookup() to test for inclusion. Lookup() is a delegatable function.

View solution in original post

Highlighted
Resolver I
Resolver I

Re: Conditional statement working only SOMETIMES

Hi @Drrickryp,

 

This approuch was working for most but still seems to only work sometimes on others

This was my updated statement

If(Not(IsBlank(LookUp(PowerBIIntegration.Data, Value = 39).Value)) ,NewForm(Form1);Navigate(Sub,ScreenTransition.Fade),If(Not(IsBlank(LookUp(PowerBIIntegration.Data, Value = 40).Value)),Navigate(Screen2,ScreenTransition.Fade),NewForm(EditForm1);Navigate(BrowseScreen1_1,ScreenTransition.Fade)))

Basically:
 - If the value is 39 THEN navigate to a form page
 - If the value is 40 THEN navigate to a different page
 - Else navigate to a different page

But this only works sometimes, as if the conditional statements are ignored and navigates to the 'Else' page.

Can you think of how to fix this?

Thank you

Highlighted
Frequent Visitor

Re: Conditional statement working only SOMETIMES

Edit: Whoops - sorry I replied to the wrong thread.

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,927)