cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

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 III
Super User III

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.
Check out my PowerApps Videos too!

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
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (4,511)