cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
joeljohn
Level: Powered On

View Icon if email is on list (collection)

Hi!

 

What is the best approach to show and Icon if the email of creator is in list. (View if is admin)

I saw some examples (Ticket System) but couldn´t replicate it.

 

//Set the isAdmin to False on event "onStart" 
Set(isAdmin,false);

 

//Add the admin emails on event "onStart"

ClearCollect(AdminList,"jjohn@mail.com");

 

//visible properties of Icon

If(MyProfile.Mail in AdminList.Value,true,false);

 

what am I not seeing?

 

tx in advance

 

 

3 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: View Icon if email is on list (collection)

Hi @joeljohn,

There is a known problem with global and context variables with the screen's  OnStart. property.  I was able to work around it though.  In the OnVisible property of the Screen:

UpdateContext({counter:counter+1})

In the Visible property of your icon

counter=1

The first time the screen is visible, the counter is set to 1 and the Visible property of the icon reduces to true. Every time thereafter, the counter is incremented and will not be 1 again until you close the app and reopen it, simulating the behaviour you desire.  If this provides you with a workable answer to your issue, please mark the thread as solved.  

View solution in original post

joeljohn
Level: Powered On

Re: View Icon if email is on list (collection)

Hi and tx for your fast response.

The example you provide me works, but how can i relate this sample with the admin list emails.
For example:

I put a label to debug the results.

The Text properties of the label i set it to : User().Mail and shows the current users emails. The same result if use Office365Users.MyProfile().Mail.
But when i try to create a collection or variable to show the admins emails it does not work.
-Create a collection ClearCollect(AdminList,"jjohn@mail.com");
-Create a variable: Set(MyProfile, User().Email) and set the Text properties equal to: MyProfile but show nothing
On the visible properties of the icon i put: If(MyProfile in AdminList, true, false)---not working, is blank

How can i use your sample to simulate this?

View solution in original post

joeljohn
Level: Powered On

Re: View Icon if email is on list (collection)

The problem with the OnStart is that you have to save and close powerapps, so changes take effects.
Even so, your answer was right

View solution in original post

3 REPLIES 3
Super User
Super User

Re: View Icon if email is on list (collection)

Hi @joeljohn,

There is a known problem with global and context variables with the screen's  OnStart. property.  I was able to work around it though.  In the OnVisible property of the Screen:

UpdateContext({counter:counter+1})

In the Visible property of your icon

counter=1

The first time the screen is visible, the counter is set to 1 and the Visible property of the icon reduces to true. Every time thereafter, the counter is incremented and will not be 1 again until you close the app and reopen it, simulating the behaviour you desire.  If this provides you with a workable answer to your issue, please mark the thread as solved.  

View solution in original post

joeljohn
Level: Powered On

Re: View Icon if email is on list (collection)

Hi and tx for your fast response.

The example you provide me works, but how can i relate this sample with the admin list emails.
For example:

I put a label to debug the results.

The Text properties of the label i set it to : User().Mail and shows the current users emails. The same result if use Office365Users.MyProfile().Mail.
But when i try to create a collection or variable to show the admins emails it does not work.
-Create a collection ClearCollect(AdminList,"jjohn@mail.com");
-Create a variable: Set(MyProfile, User().Email) and set the Text properties equal to: MyProfile but show nothing
On the visible properties of the icon i put: If(MyProfile in AdminList, true, false)---not working, is blank

How can i use your sample to simulate this?

View solution in original post

joeljohn
Level: Powered On

Re: View Icon if email is on list (collection)

The problem with the OnStart is that you have to save and close powerapps, so changes take effects.
Even so, your answer was right

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (6,645)