Conceptually, you can that Boolean variable for anything.
I'm trying to do what you told me to do but I get an error trying to do so. Here you can see what's going on:
I would think the Collect function is not right.
In your collect function you refer to Admin.Administrators but the problem here is that Admin is not your Datasource name.
Try and use Admins.Administrators or just collect the full table .
So what do you want me to do? I don't understand this part: "Collect(colAdminList,Admin.Administrators);"
Set(gblUser, User().Email); Collect(colAdminList,Admin.Administrators); Set( gblIsAdmin, !IsBlankOrError( LookUp( colAdminList, Administrators = gblUser ) ) )
Try and use this code instead:
Set(gblUser, User().Email); ClearCollect(colAdminList,Admins); Set( gblIsAdmin, !IsBlankOrError( LookUp( colAdminList, Administrators = gblUser ) ) )
The "Collect(colAdminList,Admin.Administrators);" will fetch all the record in your table and put them in a local table in the app that will store your records , this is a temporary storage that will be cleaned when you close the app , (collection) with only the column administrators.
But there is a problem here when collecting he expect a datasource (your excel table) with items. In your formula you use Admin instead of Admins.
Also in your table you only have 1 column named "Administrators", so there is no need to collect only this column and you can just collect the full table.
The difference between the Collect() and ClearCollect() function is the following:
If you have a Collection with lets say 5 items and you do the collect function, all the records that you collect will be added in this colletion.
If you use the ClearCollect() function you will first empty this collection and than add the records. In this case it also wouldn't matter because this is on start but for good measure I make a habit of using ClearCollect
Thank you so much for your help! Although the first code was already working 🙂
There was just an s missing after admin(s).administrators
Find your favorite faces from the community presenting at the Power Platform Community Conference!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.
Features releasing from October 2020 through March 2021