cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Help optimizing

Hey guys, on my app, I want it to be open for everyone, but some specific functions to a restrict employees.

 

Now I am using a formula like this.

 

Set(varUserAllows ; Or(
User().FullName = "Adilson Ferreira" ;
User().FullName = "Alexandre Wojciechowski" ;
User().FullName = "Jairo Pires Alves" ;
User().FullName = "Jesse Paula" ;
User().FullName = "Luiz Fernando Seeller" ;
User().FullName = "Mauricio Caneca Neto" ;
User().FullName = "Milton Silva" ;
User().FullName = "Rafael de Carvalho" ;
User().FullName = "Vagner Oliveira" ;
User().FullName = "Valter Diego Percegona";
User().FullName = "Edio Paulo da Silva";
User().FullName = "Sergio Cotta";
User().FullName = "Igor Oliveira";
User().FullName = "Kleber Antônio Glovatski" ;
User().FullName = "Thais Machado";
User().FullName = "Rafael Vinicius Dropa de Bortoli";
User().FullName = "Diogo Albino";
User().FullName = "Marcelo Nunes Stefano"))

 

Considering that the User().FullName is a slow function, how can I optimize it to the app load faster and get the same results?

This formula is on the OnStart property...

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Help optimizing

Hi @Anonymous,

You could try something like this:

Set(varUserAllows ; 
User().FullName in ["Adilson Ferreira" ;
                    "Alexandre Wojciechowski" ;
                    "Jairo Pires Alves" ;
                    "Jesse Paula" ;
                    "Luiz Fernando Seeller" ;
                    "Mauricio Caneca Neto" ;
                    "Milton Silva" ;
                    "Rafael de Carvalho" ;
                    "Vagner Oliveira" ;
                    "Valter Diego Percegona";
                    "Edio Paulo da Silva";
                    "Sergio Cotta";
                    "Igor Oliveira";
                    "Kleber Antônio Glovatski" ;
                    "Thais Machado";
                    "Rafael Vinicius Dropa de Bortoli";
                    "Diogo Albino";
                    "Marcelo Nunes Stefano"
                    ]
)

Or prior to that line of code, you could store the value of User.FullName into a variable and carry out the comparison against the variable value. That way, you wouldn't need to call User.FullName multiple times.

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Help optimizing

Hi @Anonymous,

You could try something like this:

Set(varUserAllows ; 
User().FullName in ["Adilson Ferreira" ;
                    "Alexandre Wojciechowski" ;
                    "Jairo Pires Alves" ;
                    "Jesse Paula" ;
                    "Luiz Fernando Seeller" ;
                    "Mauricio Caneca Neto" ;
                    "Milton Silva" ;
                    "Rafael de Carvalho" ;
                    "Vagner Oliveira" ;
                    "Valter Diego Percegona";
                    "Edio Paulo da Silva";
                    "Sergio Cotta";
                    "Igor Oliveira";
                    "Kleber Antônio Glovatski" ;
                    "Thais Machado";
                    "Rafael Vinicius Dropa de Bortoli";
                    "Diogo Albino";
                    "Marcelo Nunes Stefano"
                    ]
)

Or prior to that line of code, you could store the value of User.FullName into a variable and carry out the comparison against the variable value. That way, you wouldn't need to call User.FullName multiple times.

View solution in original post

Anonymous
Not applicable

Re: Help optimizing

Great!

 

Thanks! @timl, now the app is faster on the start..

 

 

 

 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

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
Users online (5,691)