*Edit - The expression also doesn’t work in all case scenarios. I assume that “Any” will just select one random value from the list and compare with Users[FPO]. Or Does it check all the values in the list against Users[FPO].
As a quick test, try removing the security filter and see if it fixes your problem.
Workflows / reports are ran as the app creator, and sometimes security filters can mess with this.
When you are testing the app within the app creator, the rules are ran on the data you have already loaded, so testing the formulas in-app it may appear that things are working. When the workflow runs, the data cannot be accessed because of the security filter.
This is just something to check before proceeding.
But I still have issues with expression to list all the emails this notification should be sent to.
SELECT(
Users[Email],
IN(
ANY(
SELECT(
Farmers[FPO],
(DATE([Created At]) = (TODAY() - 1))
)
),
[FPO]
)
)
This expression doesn’t work in all cases. Is there any way else to resolve this?
SELECT(Users[Email], ..., TRUE) gathers a list of distinct (per TRUE) values from the Email column from rows of the Users table that match the given criteria (...; see (6)).
COUNT([FPO] - LIST()) constructs a list of and counts the distinct values of the list in the FPO column. Subtracting one list from another has the side-effect of removing duplicates from the result.
COUNT([FPO] - SELECT(...)) constructs a list of and counts distinct values of the list in the FPO column that do not also occur in the results of the SELECT() expression (SELECT(...); see (4)).
SELECT(Farmers[FPO], ...) gathers a list of values from the FPO column from rows of the Farmers table that match the given criteria (...; see (5)).
(DATE([Created At]) = (TODAY() - 1)) matches only rows where the date component of the Created At column value (DATE([Created At])) matches yesterday’s date ((TODAY() - 1)).
(... <> ...) asks whether the counts from (2) and (3) are different. If different, the EnumList in the FPO column value contains at least one value also contained in the list gathered by the SELECT() expression (see (4)); if not different, the two lists did not overlap.
@Steve
Do we always need to remove security filters from the tables to make the notifications work?
Or is this a bug you might want to look into.
Removing security filters would mean I have to create slices for all the views related to that table and put the condition on the slice. Which gets tedious if there are lots of tables and views in the app.
The only real drawback of this is, the security filters don’t function as intended for the app creator and therefore the app experience will be different for that user. For this reason, I use a separate account to create all my AppSheet apps under rather than my primary account that I use day to day.