cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Prodigy
Post Prodigy

Re: Get emails from excel database and make a dropdown editable if they match emails with the user

What do I then put in the visible part from the icon? @GarethPrisk 

Highlighted
Super User II
Super User II

Re: Get emails from excel database and make a dropdown editable if they match emails with the user

Conceptually, you can that Boolean variable for anything.

  • When used as a Visible property, will Show for Admins, Hide for non-Admins
  • When used in an IF formula, such as
    • If ( gblIsAdmin , {doThisForAdmins}, {doThisForNonAdmins} )
    • If ( gblIsAdmin, DisplayMode.Edit, DisplayMode.Disabled ) - to set edit mode on a control, as an example
Highlighted
Post Prodigy
Post Prodigy

Re: Get emails from excel database and make a dropdown editable if they match emails with the user

Hey!

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:

https://gyazo.com/4c7898979b77f3e694aa854261f7976a

@GarethPrisk 

Highlighted
Resolver III
Resolver III

Re: Get emails from excel database and make a dropdown editable if they match emails with the user

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 .

ClearCollect(colAdminList,Admins)

 

Highlighted
Post Prodigy
Post Prodigy

Re: Get emails from excel database and make a dropdown editable if they match emails with the user

So what do you want me to do? I don't understand this part: "Collect(colAdminList,Admin.Administrators);" 

Code: 

Set(gblUser, User().Email);
Collect(colAdminList,Admin.Administrators);
Set(
    gblIsAdmin,
    !IsBlankOrError(
        LookUp(
            colAdminList,
            Administrators = gblUser
        )
    )
)


My administrators are stored in the following:

Table: Admins
Column: Administrators

@KennethNicasens @GarethPrisk 

Highlighted
Post Prodigy
Post Prodigy

Re: Get emails from excel database and make a dropdown editable if they match emails with the user

There was an "s" missing after Admin.Administrators... that fixed it

Highlighted
Resolver III
Resolver III

Re: Get emails from excel database and make a dropdown editable if they match emails with the user

@TimoMigchielsen ,

 

 

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 

View solution in original post

Highlighted
Post Prodigy
Post Prodigy

Re: Get emails from excel database and make a dropdown editable if they match emails with the user

Thank you so much for your help! Although the first code was already working 🙂

There was just an s missing after admin(s).administrators

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,739)