I am currently having an issue with an IF statement. So i have a button that on the displaymode property i am only showing if this statement is true if(!IsEmpty(Filter(Datasource, Status.Value = "Cancel Request" || Status.Value = "Active")),DisplayMode.Disabled,Edit)
but i want to add another if to check if the status is changed by the admin of the SharePoint list to Canceled, and to display the button. How can i add this? Any help will be appreciated.
@Drrickryp the button is on the beginning of the app. What i am trying to do is to only display the button based on certain conditions trigger by the user that submits the request and also by the admin of the SharePoint list that is getting edited.
If( !IsEmpty( Filter(Datasource, User().FullName =adminname AND Status.Value = "Cancelled" ), DisplayMode.Edit ), !IsEmpty( Filter( Datasource, Status.Value = OR( "Cancel Request" ,"Active" ) ),DisplayMode.Disabled ), DisplayMode.Edit )
I believe this formula will test to see first, if the User is the administrator and the status is "Cancelled", it that is true then the Display mode is Edit and the rest of the statement is ignored. If that test fails because the filter is empty, then the next test is to see if the status value is either "Cancel Request" or "Active'. If that is true then the display mode is disabled and the rest of the statement is ignored and the display mode is set to Edit. If statements will execute conditions in order until the first true condition is found. So, it is important to put the conditional statements in the right order.
If my logic is wrong, we should be able to work on each condition until it is correct.
Keep up to date with current events and community announcements in the Power Apps community.
A great place where you can stay up to date with community calls and interact with the speakers.
Check out the latest Community Blog from the community!