cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Saurabh-704 Helper I
Helper I

How to check list CDS entity list in powerapps

Hello !

how to check CDS entity list.

My scenario is that one login page is there where user has to enter their name , email and password and this all will be saved into CDS entity.

After this whenever they try to login second time user has to provide email id and password if it matches then only it should allow you to navigate to different screen.

So to check this email and password is matching or not what should we do ?

 

How can we check CDS list that whether email and password is matching or not?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft
Microsoft

Re: How to check list CDS entity list in powerapps

Hi Saurabh-704:

Firstly, I would like to confirm with you whether my following understanding is correct:

  • Registration is required when the user logs in to the app for the first time.
  • After the user submits the registration information, these data are stored in the CDS entity.
  • When the user logs in for the second time, check his email address and password, and if it matches the data in the database, navigate to sceen1.

Secondly,I assume that the feathers that I mentioned above are what you want, here is my solution for your reference:

My entity:

MYAccounts

Fields:

Name(Primary field)-Text

emailaddress-Text

password-Text

step1:add a welcome screen(Welcome)

1\add two text input controls(TextInput1/TextInput2)

One for email address and one for password

2\add a label control and set it’s property:

Text: "I want to register an account"

OnSelect :Navigate(Registered)   /* Registered is the Registered screen*/

3\add a button control and set it’s property:

Text: "sign in"

OnSelect:

 

If(
    LookUp(
        MYAccounts,
        emailaddress = TextInput1.Text
    ).password = TextInput2.Text,
    Navigate(screen1),
    Notify("Wrong account or wrong password!")
)

 

 

1.jpg

 

Step2:add a Registered screen(Registered)

1\ add three text input controls(TextInput3/TextInput4/TextInput5)

One for email address ,one for password, one for name

2\add a button control and set it’s property:

Text: "Registered"

OnSelect: 

 

If(
    IsEmpty(
        LookUp(
            MYAccounts,
            emailaddress = TextInput5.Text
        )
    ),
    Collect(
        MYAccounts,
        {
            Name: TextInput3.Text,
            password: TextInput4.Text,
            emailaddress: TextInput5.Text
        }
    );
    Navigate(Welcome),
    Notify("The account already exists")
)

 

 

2.jpg

 

Step3:add a screen(screen1)

It is the different screen (“it should allow you to navigate to different screen”)

 

After the user opens the app, they can enter their email address and password to log in or register for a new account.

Case1:If the email address and password are correct, the user can navigate to screen1.

Case2:If the email address or password are wrong, a banner message("Wrong account or wrong password!") will pop up to the user at the top of the screen.

If the user chooses to register for an account, they will navigate to the registration screen. After filling in the registration information, users can click Register to complete the registration.

Case1:If this email address is already registered, a banner message("The account already exists") will pop up to the user at the top of the screen.

Case2:If this email address isnt already registered, the application will save the information to the CDS entity and then navigate to the welcome screen

 

Best Regards,

Bof

View solution in original post

3 REPLIES 3
Microsoft
Microsoft

Re: How to check list CDS entity list in powerapps

Hi Saurabh-704:

Firstly, I would like to confirm with you whether my following understanding is correct:

  • Registration is required when the user logs in to the app for the first time.
  • After the user submits the registration information, these data are stored in the CDS entity.
  • When the user logs in for the second time, check his email address and password, and if it matches the data in the database, navigate to sceen1.

Secondly,I assume that the feathers that I mentioned above are what you want, here is my solution for your reference:

My entity:

MYAccounts

Fields:

Name(Primary field)-Text

emailaddress-Text

password-Text

step1:add a welcome screen(Welcome)

1\add two text input controls(TextInput1/TextInput2)

One for email address and one for password

2\add a label control and set it’s property:

Text: "I want to register an account"

OnSelect :Navigate(Registered)   /* Registered is the Registered screen*/

3\add a button control and set it’s property:

Text: "sign in"

OnSelect:

 

If(
    LookUp(
        MYAccounts,
        emailaddress = TextInput1.Text
    ).password = TextInput2.Text,
    Navigate(screen1),
    Notify("Wrong account or wrong password!")
)

 

 

1.jpg

 

Step2:add a Registered screen(Registered)

1\ add three text input controls(TextInput3/TextInput4/TextInput5)

One for email address ,one for password, one for name

2\add a button control and set it’s property:

Text: "Registered"

OnSelect: 

 

If(
    IsEmpty(
        LookUp(
            MYAccounts,
            emailaddress = TextInput5.Text
        )
    ),
    Collect(
        MYAccounts,
        {
            Name: TextInput3.Text,
            password: TextInput4.Text,
            emailaddress: TextInput5.Text
        }
    );
    Navigate(Welcome),
    Notify("The account already exists")
)

 

 

2.jpg

 

Step3:add a screen(screen1)

It is the different screen (“it should allow you to navigate to different screen”)

 

After the user opens the app, they can enter their email address and password to log in or register for a new account.

Case1:If the email address and password are correct, the user can navigate to screen1.

Case2:If the email address or password are wrong, a banner message("Wrong account or wrong password!") will pop up to the user at the top of the screen.

If the user chooses to register for an account, they will navigate to the registration screen. After filling in the registration information, users can click Register to complete the registration.

Case1:If this email address is already registered, a banner message("The account already exists") will pop up to the user at the top of the screen.

Case2:If this email address isnt already registered, the application will save the information to the CDS entity and then navigate to the welcome screen

 

Best Regards,

Bof

View solution in original post

Saurabh-704 Helper I
Helper I

Re: How to check list CDS entity list in powerapps

Thank you so much @v-bofeng-msft for your time for explaining this concept in details

Saurabh-704 Helper I
Helper I

Re: How to check list CDS entity list in powerapps

Hello @v-bofeng-msft !! Thank you for your last solution. I have one more doubt like If user want to reset the password ...like if user click on reset the password..then he gives email Id and username....then he enters new password..so how can we update this new password to that CDS entity fields ..infront of that username?

Thanks in advance!!

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

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