Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.

How to limit a list of email to "Adds_Only"

Hello,

In "Data", "Table", "Are updates allowed?" There is a default formula and I tried to rewrite it as below:

SWITCH(USEREMAIL(), 
  any(select(AddsOnlyTable[AddsOnlyColumn],true)), "ADDS_ONLY", 
  "myemail@gmail.com", "ALL_CHANGES", 
  "READ_ONLY")

What I want to do is trying to limit a user email list - AddsOnlyTable[AddsOnlyColumn] who can add only.

However it doesn't work as expected. May I know how can I rewrite it and make it works?

Thank you.

@Steve @Joseph_Seddik 

Solved Solved
0 2 212
1 ACCEPTED SOLUTION

Hello @LawrenceMa, I suggest you implement a current user system for this, I believe it is the best way to go around it.

In any case, you could try this expression for solving your inmediate query:

SWITCH(USEREMAIL(), 
  INDEX(INTERSECT(list(useremail()),AddsOnlyTable[AddsOnlyColumn]),1),"ADDS_ONLY", 
  "myemail@gmail.com","ALL_CHANGES", 
  "READ_ONLY")




View solution in original post

2 REPLIES 2

Hello @LawrenceMa, I suggest you implement a current user system for this, I believe it is the best way to go around it.

In any case, you could try this expression for solving your inmediate query:

SWITCH(USEREMAIL(), 
  INDEX(INTERSECT(list(useremail()),AddsOnlyTable[AddsOnlyColumn]),1),"ADDS_ONLY", 
  "myemail@gmail.com","ALL_CHANGES", 
  "READ_ONLY")




@Rafael_ANEIC-PY 

@LawrenceMa 

 

Hi all, could you plz explain this code for me.

and why did you add "1"

 

 

SWITCH(USEREMAIL(), 
  INDEX(INTERSECT(list(useremail()),AddsOnlyTable[AddsOnlyColumn]),1),"ADDS_ONLY", 
  "myemail@gmail.com","ALL_CHANGES", 
  "READ_ONLY")

 

I've applied your code into my app:

 

SWITCH(USEREMAIL(),
INDEX(INTERSECT(list(useremail()),Sellers[Email]),1),"ALL_CHANGES",
"READ_ONLY")

Top Labels in this Space