cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rpowell
Frequent Visitor

Performing an IF condition

I am trying to perform an IF condition. Based on my ExpenseID being IsBlank or NOT IsBlank.

The IsBlank condition is firing as expect. By displaying my NOTIFY, REMOVING my record & Navigating back to my browse screen.

 

But, my NOT IsBlank is firing. But it's throwing my NOTIFY message from my IsBlank condition? I am missing something. But I do not see it.

 

 

If (
    Not IsBlank(
        Navigate(
            TravelExpenseLineItemGallery,
            ScreenTransition.Fade,
            {SelectedExpenseID: 'Travel Expense Browse'.Selected.ExpenseID}
        )
    );
    Notify("Travel Expense Detail Records must be removed. Before Travel Form can be deleted!"),
    Navigate(
        'Travel Expense Browse Screen',
        ScreenTransition.None
    )
);


If (
    IsBlank(
        Navigate(
            TravelExpenseLineItemGallery,
            ScreenTransition.Fade,
            {SelectedExpenseID: 'Travel Expense Browse'.Selected.ExpenseID}
        )
    );
    Notify("No Travel Expense Detail Records. Travel Expense has been deleted!"),
    Remove(
        '[dbo].[FusdTravelExpenseForm]',
        'Travel Expense Browse'.Selected
    );
    Navigate(
        'Travel Expense Browse Screen',
        ScreenTransition.None
    )
)

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
rpowell
Frequent Visitor

Re: Performing an IF condition

Thansk for tip. I was able to get this to work by doing the following:

 

If (
    IsBlank(
        LookUp(
            '[dbo].[FusdTravelExpenseLineItems]',
            ExpenseID = ThisItem.ExpenseID
        ).ExpenseID
    ),
    Notify(
        "No Travel Expense Detail Records. Travel Expense has been deleted!",
        Success
    );
    Remove(
        '[dbo].[FusdTravelExpenseForm]',
        'Travel Expense Browse'.Selected
    ),
    Notify("Travel Expense Detail Records must be removed. Before Travel Form can be deleted!")
)

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Performing an IF condition

Your IsBlank condition is based on the result of the Navigate function??

 

The Navigate function returns a True or False.

Navigate normally returns true but returns false if there is a problem with one of its arguments.

You should be basing your If condition on IsBlank(ExpenseID) or !IsBlank(ExpenseID).

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
rpowell
Frequent Visitor

Re: Performing an IF condition

Thansk for tip. I was able to get this to work by doing the following:

 

If (
    IsBlank(
        LookUp(
            '[dbo].[FusdTravelExpenseLineItems]',
            ExpenseID = ThisItem.ExpenseID
        ).ExpenseID
    ),
    Notify(
        "No Travel Expense Detail Records. Travel Expense has been deleted!",
        Success
    );
    Remove(
        '[dbo].[FusdTravelExpenseForm]',
        'Travel Expense Browse'.Selected
    ),
    Notify("Travel Expense Detail Records must be removed. Before Travel Form can be deleted!")
)

View solution in original post

Helpful resources

Announcements
secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (6,338)