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

Login check

Hi, good afternoon to everyone, I have this function:

If(LookUp('[dbo].[usuarios]'; usunom = TextInput4.Text; usucontra) = TextInput6.Text; Navigate(Screen1;ScreenTransition.Fade);Navigate(Label36;ScreenTransition.Fade;{incorrecto:1}))


In which I have armed a table in sql containing grupoid (int), id (int), usunom, usucontra.
The function to check if the user exists or not, everything works fine but I also need to enter no data to verify in which group this is and depending on the group in which you are navigate to the corresponding page. If you can help me it would be great. From already thank you very much

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Login check

Hi @jdelacrettaz,

 

I got your idea. Please try with the code below:

If(
    !IsBlank(filter('[dbo].[usuarios]', usunom=TextInput4.text)
                ),
    If( 
         lookup('[dbo].[usuarios]', 
                and(usunom = TextInput4.Text,
                    usucontra = TextInput6.Text), 
                grupoid
                 )=1,
         Navigate(Screen1;ScreenTransition.Fade),
         Navigate(Screen2;ScreenTransition.Fade)
       ),
"User Does not exist"
)

The first if checks whether user exists in the table, if user name exists (the filter table is not blank), it will then check if the user and the password matches the one recorded, find the match and the nreturn the grupoid from the record with lookup function, then naviagte to the proper screen (this step assume you only have two grupoid),

 

If user does not exist, the formula above would then show text

"User Does not exist"

Or you may change this part to the formula you prefer.

Regards,

Michael 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 REPLIES 3
jdelacrettaz
Level: Powered On

Re: Login check

Complete the idea, I have armed the table as follows

 

grupoid            id              usunom(name)         usucontra(password)

1                      1               jonathan                        hellow

1                      2               rodrigo                           yes

2                      3                Susana                          red

 

As you can see susana has another group id, so what I want to do is to find me whether or not the user exists, if the user exists and the password is fine, I want you to tell me which group this is. Once I find in what group it is I want to do an if it asks if the group is 1, that it does a navigate to a screen and if the group is 2 it navigates to another different screen. If anyone has any ideas to help me I would appreciate it. From already thank you very much

Community Support Team
Community Support Team

Re: Login check

Hi @jdelacrettaz,

 

I got your idea. Please try with the code below:

If(
    !IsBlank(filter('[dbo].[usuarios]', usunom=TextInput4.text)
                ),
    If( 
         lookup('[dbo].[usuarios]', 
                and(usunom = TextInput4.Text,
                    usucontra = TextInput6.Text), 
                grupoid
                 )=1,
         Navigate(Screen1;ScreenTransition.Fade),
         Navigate(Screen2;ScreenTransition.Fade)
       ),
"User Does not exist"
)

The first if checks whether user exists in the table, if user name exists (the filter table is not blank), it will then check if the user and the password matches the one recorded, find the match and the nreturn the grupoid from the record with lookup function, then naviagte to the proper screen (this step assume you only have two grupoid),

 

If user does not exist, the formula above would then show text

"User Does not exist"

Or you may change this part to the formula you prefer.

Regards,

Michael 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
azzamkaz
Level: Powered On

Re: Login check

@v-micsh-msft 

 

This code need user to register first before login or the login details already provided in database and link to text input, and user simply login the page by the ID and Password already given/exist  ?

May I know what data storage this code using? If im using excel is that possible ?

can you give some direct solutions.... apperciate your kind assistance, thank you

 

 

rgd

azzamkaz

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 160 members 5,445 guests
Recent signins:
Please welcome our newest community members: