Hello,
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.
Thank you
Hi @patty789
It is not clear to me what the context of your issue is. Are you referring to a button on an Edit form?
I got that. Where is the button and what are you trying to do with it? Could you provide a screenshot?
@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.
@Drrickryp no i don't as they are not going to access the app. They will only be using the SharePoint list for editing the Status Column.
Hi @patty789
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.
User | Count |
---|---|
254 | |
101 | |
94 | |
47 | |
38 |