The desktop version seems to have an issue with the coding being applied incorrectly.

I have developed an app that provides points, and the administrator has set a limit of 1 provision per day for the [user account] worker. The app works well on the mobile version, but on the PC desktop version, the "1 provision per day" message is still appearing even though the provision is being made only once a day. What could be the reason for this?

 

IF(
Userrole() = "Admin",
TRUE,
IF(
Userrole() = "User",
IF(
COUNT(
FILTER(
"Thumbs Up",
AND(
[email] = [_THISROW].[eamil],
YEAR([point day]) = YEAR([_THISROW].[point day]),
MONTH([point day]) = MONTH([_THISROW].[point day]),
DAY([point day]) = DAY([_THISROW].[point day])
)
)
) = 1,
FALSE,
TRUE
),
FALSE
)
)

Solved Solved
0 2 232
1 ACCEPTED SOLUTION

Aurelien
Google Developer Expert
Google Developer Expert

Hi @seyoonkwon 

Mobile and Desktop interfaces should be consistent. If not, please file a ticket with the support here: Contact Us - AppSheet Help

At looking to your expression, I would suggest a slight simplification:

IF(
  Userrole() = "Admin",
  TRUE,
  IF(
    Userrole() = "User",
    IF(
      COUNT(
        FILTER("Thumbs Up",
          AND(
            [email] = [_THISROW].[eamil],
            YEAR([point day]) = YEAR([_THISROW].[point day]),
            MONTH([point day]) = MONTH([_THISROW].[point day]),
            DAY([point day]) = DAY([_THISROW].[point day])
          )
        )
      ) = 1,
    FALSE,
    TRUE
    ),
    FALSE
  )
)

 into:

OR(  
  USERROLE() = "Admin",
  AND(
    USERROLE() = "User",
    COUNT(
      FILTER("Thumbs Up",
        AND(
            [email] = [_THISROW].[email],
            YEAR([point day]) = YEAR([_THISROW].[point day]),
            MONTH([point day]) = MONTH([_THISROW].[point day]),
            DAY([point day]) = DAY([_THISROW].[point day])
        )
      )
    ) <> 1
  )
)

View solution in original post

2 REPLIES 2

Aurelien
Google Developer Expert
Google Developer Expert

Hi @seyoonkwon 

Mobile and Desktop interfaces should be consistent. If not, please file a ticket with the support here: Contact Us - AppSheet Help

At looking to your expression, I would suggest a slight simplification:

IF(
  Userrole() = "Admin",
  TRUE,
  IF(
    Userrole() = "User",
    IF(
      COUNT(
        FILTER("Thumbs Up",
          AND(
            [email] = [_THISROW].[eamil],
            YEAR([point day]) = YEAR([_THISROW].[point day]),
            MONTH([point day]) = MONTH([_THISROW].[point day]),
            DAY([point day]) = DAY([_THISROW].[point day])
          )
        )
      ) = 1,
    FALSE,
    TRUE
    ),
    FALSE
  )
)

 into:

OR(  
  USERROLE() = "Admin",
  AND(
    USERROLE() = "User",
    COUNT(
      FILTER("Thumbs Up",
        AND(
            [email] = [_THISROW].[email],
            YEAR([point day]) = YEAR([_THISROW].[point day]),
            MONTH([point day]) = MONTH([_THISROW].[point day]),
            DAY([point day]) = DAY([_THISROW].[point day])
        )
      )
    ) <> 1
  )
)

Thanks!!

Top Labels in this Space