Adding IF Condition to "Add" buton in Actions

I developed an app about the product order.I used to "order capture how to" as an example.  I want the user to be able to  change only its order, not others. I add the following statement 

IF(INDEX(FILTER("Users", ([Email] = USEREMAIL())),1)=INDEX(LIST([Order Id].[Ordered By]), 1),true,false)

but it did not work. Does someone have an idea to overcome this issue?

0 3 69
3 REPLIES 3

If I understand correctly, users should be allowed to Edit only the Orders that they entered.  And you are capturing the user who entered the order in the column {Ordered By]. Do I have it correct?

If so, then it is not the "Add" button you want to place the condition on, it is the Edit button.  Also, the expression is much simpler.

Use this expression in the "Only if this condition is true" area of the Order Edit button:

[Ordered By] = USEREMAIL()

I hope this helps!

Thank you for your answer. Yes, You got the point. 

In the following picture, when the user click the order which is made by other user, the user can add a product. I do not want it to be able to done by other users. So, I want that  "add" buton shouldn't be active for all users . Is it possible to do that? 

Noone__0-1694365299146.png

 


@Noone_ wrote:

So, I want that  "add" buton shouldn't be active for all users . Is it possible to do that? 


Yes, BUT...an "Add" button is not a row-level action so it DOES NOT have reference to row data you can use in its criteria.  Thus, you cannot reference the column [Ordered By], to disable the button in the manner you are attempting.  You would need to find another way.

For example, one way would to have 2 Slices + views:

  1. One with ALL orders set as view only that a user can look over the orders but there is no ability to Add or Edit
  2. A second with ONLY the orders placed by the logged in user - this view set allows Adds and Edits.
Top Labels in this Space