cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HarishaAkkil
Helper IV
Helper IV

Can Case sensitive look up can be done in PowerApps using SharePoint list as a data source?

Hi Team,

 

I have made an app in PowerApps which uses the SharePoint list as a data source. From which it look-up for the "Password" column value to sign in to the app. The below screenshot shows the sign-in page of my application.

 

Sign in page.jpg

 

In the OnSelect function, I wrote the following formula to sign in to the app.

 

If(CountRows(Filter('SPLIST',And(INPUTEMPID.Text=SPCOLUMN,INPUTPWD.Text=SPCOLUMN)))=1,Navigate('Menu Page',ScreenTransition.UnCover),Notify("Incorrect Login Details",NotificationType.Error));

 

where SPCOLUMN of Employee Id is a number so no need to worry in comparison. Whereas the Password column is a "Single line of text" comprises string. It when compared, compares regardless of case sensitivity.

 

For example: If I have the record in Password as "ABCD" it allows me to log in to the app even if I type "abcd".

 

So could you please give me a suggestion on this to work the app with case-sensitively?

 

And for your note, if I use the function LookUp instead of Filter also results in the same output.

 

Thanks in advance for your help!

 

Thank You,

Harisha

20 REPLIES 20

I will explain clearly what it specifies,

 

If(CountRows(Filter('SPLIST',And(INPUTEMPID.Text=SPCOLUMN,INPUTPWD.Text=SPCOLUMN)))=1,Navigate('Menu Page',ScreenTransition.UnCover),Notify("Incorrect Login Details",NotificationType.Error));

 

SPLIST is a SharePoint list where the details of the user are stored.

INPUTEMPID is a power apps control where the user enters his/her employee id.

INPUTEMPID.Text=SPCOLUMN  >>> here the SPCOLUMN specifies the column (Column name =Employee Id) in the SharePoint list.

INPUTPWD is a power apps control where the user enters the password.

INPUTPWD.Text=SPCOLUMN >>> here the SPCOLUMN specifies another column (Column name = Password) in SharePoint list.

 

When using LookUp function again it compares case-insensitively.

 

And here is what my problem is,

when I am using this formula for logging in, the employee id doesn't have any problem since it is a number field declared in SharePoint as well as in Powerapps.

But when comes to the Password field, it is defined as "Single line of text" in SP means it allows alpha-numeric. So when a user enters the password regardless of the case it allows the user to log in.

 

You can ask me if you have any doubts are queries regarding this problem.

 

Thanks for your patience!

Harisha

PowerAddict
Most Valuable Professional
Most Valuable Professional

These details are in line with what I had assumed for my previous post. Did you give that a try?
v-xida-msft
Community Support
Community Support

Hi @HarishaAkkil ,

Based on the needs that you mentioned, I think the Lower function could achieve your needs.

 

Please consider modify your formula within the OnSelect property of the "Sign in" button to following:

If(
   Lower(LookUp('SPLIST', EmployeeId = Value(INPUTEMPID.Text), Password)) = Lower(INPUTPWD.Text),
   Navigate('Menu Page',ScreenTransition.UnCover),
   Notify("Incorrect Login Details", NotificationType.Error)
)

Note: The EmployeId and Password represent columns in your SP List, you should replace them with actual column name from your SP list within above formula. And the EmployeeId column is a Number type column in your SP list

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-xida-msft ,

 

I tried the formula as you suggested. But it did not work properly. If the user enters the right password also, it fails to log in to the app.

 

Thanks!

Harisha

Hi @HarishaAkkil ,

Please add a Label in your screen, set the Text property to following:

LookUp('SPLIST', EmployeeId = Value(INPUTEMPID.Text), Password)

then check if the corresponding Password value would be displayed based on the typed EmployeeId value. Is there something error message with this function?

 

Also please make sure you do not type additional spaces within the EmployeeId box and Password Text Box. Please modify your formula as below:

If(
   Lower(
          Trim(LookUp('SPLIST', EmployeeId = Value(INPUTEMPID.Text), Password))
   ) = Lower(Trim(INPUTPWD.Text)),
   Navigate('Menu Page',ScreenTransition.UnCover),
   Notify("Incorrect Login Details", NotificationType.Error)
)

or

If(
   Lower(
          Trim(LookUp('SPLIST', EmployeeId = Value(INPUTEMPID.Text)).Password)
   ) = Lower(Trim(INPUTPWD.Text)),
   Navigate('Menu Page',ScreenTransition.UnCover),
   Notify("Incorrect Login Details", NotificationType.Error)
)

Please make sure you have replaced the EmployeeId and Password with actual column name from your SP list.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-xida-msft ,

 

None of the formula works. The same problem persists even if I give the correct login details also it is not allowing the user to successfully log in.

And as for the text box property, it is not displaying the password of the corresponding employee id.

 

Thanks!

Harisha

Hi @HarishaAkkil ,

Could you please share a bit more about the data structure of your SP List?

Is the 'EmployeeId' a Number type column or a Text type column in your SP List?

Could you please share a screenshot about the formula you used within your app?

 

Based on the needs that you mentioned, I think the solution I provided above could achieve your needs. Firstly, please make sure the EmployeeId value you typed within the EmployeeId Text Box is already existed in your SP List. If not, the LookUp formula I provided above would return Blank value.

 

Please modify your formula as below:

If(
   Not(Trim(INPUTEMPID.Text) in 'SPLIST'.EmployeeId),  // Check if the entered EmployeeId is existed in data source already
   Notify("The EmployeeId you entered is not existd in your data source, please consider create a new one", NotificationType.Error),
   Lower(
          LookUp('SPLIST', EmployeeId = Trim(INPUTEMPID.Text)).Password
   ) = Lower(Trim(INPUTPWD.Text)),
   Navigate('Menu Page', ScreenTransition.UnCover),
   Notify("Incorrect Login Details", NotificationType.Error)
)

Note: I assume that the EmployeeId is a Text type column in your SP List.

or

If(
   Not(Trim(INPUTEMPID.Text) in 'SPLIST'.EmployeeId),  // Check if the entered EmployeeId is existed in data source already
   Notify("The EmployeeId you entered is not existd in your data source, please consider create a new one", NotificationType.Error),
   Lower(
          First(Filter('SPLIST', EmployeeId = Trim(INPUTEMPID.Text))).Password
   ) = Lower(Trim(INPUTPWD.Text)),
   Navigate('Menu Page', ScreenTransition.UnCover),
   Notify("Incorrect Login Details", NotificationType.Error)
)

 

Please make sure the EmployeeId you typed within your canvas app is already existed in your SP List data source already. And you do not type additional space within the EmployeeId Text Box. If there is some error message with the formula, please share screenshot about it, so we can help you better in your scenario.

 

In addition, you could consider type proper Password value (from your SP List) within the Password Text box, then try your "Sign in" button, check if the issue still exists. If the issue still exists, I think there is something wrong with the formula to retrieve data from your SP list.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-xida-msft ,

 

My SharePoint list consist of columns: EmployeeID (which is a number field allows only numbers) and another one Password (which is a single line of text, allows alpha-numeric text).

 

This is the sign in page created in Power Apps,

Sigin.jpg

 

Firstly I used the below formula in the Sign in button-

 

If(CountRows(Filter('SPLIST',And(inputEmpId.Text=EmployeeID,inputPwd.Text=Password)))=1,Navigate('Menu Page',ScreenTransition.UnCover),Notify("Incorrect Login Details",NotificationType.Error)

 

It is working fine. It is allowing the user to login if the user entered his correct employee id and password.

 

Later on, I found that, it has some errors,

For example: The EmployeeID  is 001 and the corresponding Password is TeSt is stored in the list.

In the Power Apps, if the user enters either of the combination of choice below it is allowing the user to login.

1. EmployeeID = 001 and Passoword = test

2. EmployeeID = 001 and Passoword = TEST

3. EmployeeID = 001 and Passoword = tEsT

 

So my question is, Is there a way such that the Power Apps should allow the user to log in only if the user enters the credentials as EmployeeID = 001 and Passoword = TeSt ?

 

And as mentioned in your reply I tried the formulas and again it is not working as expected.

 

Thanks!

Harisha

HI @HarishaAkkil ,

Is the EmployeeId a unique column value within your SP list?

Could you please share a screenshot about the EmployeeId field in your SP List?

 

I assume that the EmployeeID column is a unique column within your SP List, and only single one Password matches this EmployeeID value.

 

Please modify your formula as below:

If(
    Lower(First(Filter('SPLIST', EmployeeID = inputEmpId.Text)).Password) = Lower(inputPwd.Text),
    Navigate('Menu Page',ScreenTransition.UnCover),
    Notify("Incorrect Login Details",NotificationType.Error)
)

Based on the needs that you mentioned, I think above formula could achieve your needs. You could consider add a Label in your app, set the Text property to following:

First(Filter('SPLIST', EmployeeID = inputEmpId.Text)).Password

then check if the Label could display proper Password value from your SP list.

 

In addition, I think there is something wrong with your EmployeeID column. As you mentioned, if the EmployeeID is number type field in your SP list, when you store 001 into this field within your SP List, it would store it as 1 rather than 001. Please consider change the EmployeeID field in your SP list into a Single line of Text type, then refresh the data source in your app, try above formula, check if the issue is solved.

 

If the EmployeeID field is a Number type column, when comparing with inputEmpId Text value, it would show up a type incompatible issue within your Filter function. As an fixed solution, you should modify above formula as below:

If(
    Lower(First(Filter('SPLIST', EmployeeID = Value(inputEmpId.Text))).Password) = Lower(inputPwd.Text),
    Navigate('Menu Page',ScreenTransition.UnCover),
    Notify("Incorrect Login Details",NotificationType.Error)
)

 

Best regards, 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
PowerAddict
Most Valuable Professional
Most Valuable Professional

Hi @HarishaAkkil

Did you try what was posted in message #10 in this post? It works perfectly fine for me.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

Helpful resources

Announcements

April 2024 Commnuity Newsletter

We're pleased to share the April Community Newsletter, where we highlight the latest news, product releases, upcoming events, and the amazing work of our outstanding Community members.   If you're new to the Community, please make sure to follow the latest News & Announcements and check out the Community on LinkedIn as well! It's the best way to stay up-to-date with all the news from across Microsoft Power Platform and beyond.    COMMUNITY HIGHLIGHTS   Check out the most active community members of the last month! These hardworking members are posting regularly, answering questions, kudos, and providing top solutions in their communities. We are so thankful for each of you--keep up the great work! If you hope to see your name here next month, follow these awesome community members to see what they do!   Power AppsPower AutomateCopilot StudioPower PagesWarrenBelzDeenujialexander2523ragavanrajanLaurensMManishSolankiMattJimisonLucas001AmikcapuanodanilostephenrobertOliverRodriguestimlAndrewJManikandanSFubarmmbr1606VishnuReddy1997theMacResolutionsVishalJhaveriVictorIvanidzejsrandhawahagrua33ikExpiscornovusFGuerrero1PowerAddictgulshankhuranaANBExpiscornovusprathyooSpongYeNived_Nambiardeeksha15795apangelesGochixgrantjenkinsvasu24Mfon   LATEST NEWS Business Applications Launch Event - On Demand In case you missed the Business Applications Launch Event, you can now catch up on all the announcements and watch the entire event on-demand inside Charles Lamanna's latest cloud blog.   This is your one stop shop for all the latest Copilot features across Power Platform and #Dynamics365, including first-hand looks at how companies such as Lenovo, Sonepar, Ford Motor Company, Omnicom and more are using these new capabilities in transformative ways. Click the image below to watch today!     Power Platform Community Conference 2024 is here! It's time to look forward to the next installment of the Power Platform Community Conference, which takes place this year on 18-20th September 2024 at the MGM Grand in Las Vegas!   Come and be inspired by Microsoft senior thought leaders and the engineers behind the #PowerPlatform, with Charles Lamanna, Sangya Singh, Ryan Cunningham, Kim Manis, Nirav Shah, Omar Aftab and Leon Welicki already confirmed to speak. You'll also be able to learn from industry experts and Microsoft MVPs who are dedicated to bridging the gap between humanity and technology. These include the likes of Lisa Crosbie, Victor Dantas, Kristine Kolodziejski, David Yack, Daniel Christian, Miguel Félix, and Mats Necker, with many more to be announced over the coming weeks.   Click here to watch our brand-new sizzle reel for #PPCC24 or click the image below to find out more about registration. See you in Vegas!     Power Up Program Announces New Video-Based Learning Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram. These include a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the image below to find out more!     UPCOMING EVENTS Microsoft Build - Seattle and Online - 21-23rd May 2024 Taking place on 21-23rd May 2024 both online and in Seattle, this is the perfect event to learn more about low code development, creating copilots, cloud platforms, and so much more to help you unleash the power of AI.   There's a serious wealth of talent speaking across the three days, including the likes of Satya Nadella, Amanda K. Silver, Scott Guthrie, Sarah Bird, Charles Lamanna, Miti J., Kevin Scott, Asha Sharma, Rajesh Jha, Arun Ulag, Clay Wesener, and many more.   And don't worry if you can't make it to Seattle, the event will be online and totally free to join. Click the image below to register for #MSBuild today!     European Collab Summit - Germany - 14-16th May 2024 The clock is counting down to the amazing European Collaboration Summit, which takes place in Germany May 14-16, 2024. #CollabSummit2024 is designed to provide cutting-edge insights and best practices into Power Platform, Microsoft 365, Teams, Viva, and so much more. There's a whole host of experts speakers across the three-day event, including the likes of Vesa Juvonen, Laurie Pottmeyer, Dan Holme, Mark Kashman, Dona Sarkar, Gavin Barron, Emily Mancini, Martina Grom, Ahmad Najjar, Liz Sundet, Nikki Chapple, Sara Fennah, Seb Matthews, Tobias Martin, Zoe Wilson, Fabian Williams, and many more.   Click the image below to find out more about #ECS2024 and register today!   Microsoft 365 & Power Platform Conference - Seattle - 3-7th June If you're looking to turbo boost your Power Platform skills this year, why not take a look at everything TechCon365 has to offer at the Seattle Convention Center on June 3-7, 2024.   This amazing 3-day conference (with 2 optional days of workshops) offers over 130 sessions across multiple tracks, alongside 25 workshops presented by Power Platform, Microsoft 365, Microsoft Teams, Viva, Azure, Copilot and AI experts. There's a great array of speakers, including the likes of Nirav Shah, Naomi Moneypenny, Jason Himmelstein, Heather Cook, Karuana Gatimu, Mark Kashman, Michelle Gilbert, Taiki Y., Kristi K., Nate Chamberlain, Julie Koesmarno, Daniel Glenn, Sarah Haase, Marc Windle, Amit Vasu, Joanne C Klein, Agnes Molnar, and many more.   Click the image below for more #Techcon365 intel and register today!   For more events, click the image below to visit the Microsoft Community Days website.    

Tuesday Tip | Update Your Community Profile Today!

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   We're excited to announce that updating your community profile has never been easier! Keeping your profile up to date is essential for staying connected and engaged with the community.   Check out the following Support Articles with these topics: Accessing Your Community ProfileRetrieving Your Profile URLUpdating Your Community Profile Time ZoneChanging Your Community Profile Picture (Avatar)Setting Your Date Display Preferences Click on your community link for more information: Power Apps, Power Automate, Power Pages, Copilot Studio   Thank you for being an active part of our community. Your contributions make a difference! Best Regards, The Community Management Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Tuesday Tip: Community User Groups

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: Community User Groups and YOU Being part of, starting, or leading a User Group can have many great benefits for our community members who want to learn, share, and connect with others who are interested in the Microsoft Power Platform and the low-code revolution.   When you are part of a User Group, you discover amazing connections, learn incredible things, and build your skills. Some User Groups work in the virtual space, but many meet in physical locations, meaning you have several options when it comes to building community with people who are learning and growing together!   Some of the benefits of our Community User Groups are: Network with like-minded peers and product experts, and get in front of potential employers and clients.Learn from industry experts and influencers and make your own solutions more successful.Access exclusive community space, resources, tools, and support from Microsoft.Collaborate on projects, share best practices, and empower each other. These are just a few of the reasons why our community members love their User Groups. Don't wait. Get involved with (or maybe even start) a User Group today--just follow the tips below to get started.For current or new User Group leaders, all the information you need is here: User Group Leader Get Started GuideOnce you've kicked off your User Group, find the resources you need:  Community User Group ExperienceHave questions about our Community User Groups? Let us know! We are here to help you!

Super User of the Month | Ahmed Salih

We're thrilled to announce that Ahmed Salih is our Super User of the Month for April 2024. Ahmed has been one of our most active Super Users this year--in fact, he kicked off the year in our Community with this great video reminder of why being a Super User has been so important to him!   Ahmed is the Senior Power Platform Architect at Saint Jude's Children's Research Hospital in Memphis. He's been a Super User for two seasons and is also a Microsoft MVP! He's celebrating his 3rd year being active in the Community--and he's received more than 500 kudos while authoring nearly 300 solutions. Ahmed's contributions to the Super User in Training program has been invaluable, with his most recent session with SUIT highlighting an incredible amount of best practices and tips that have helped him achieve his success.   Ahmed's infectious enthusiasm and boundless energy are a key reason why so many Community members appreciate how he brings his personality--and expertise--to every interaction. With all the solutions he provides, his willingness to help the Community learn more about Power Platform, and his sheer joy in life, we are pleased to celebrate Ahmed and all his contributions! You can find him in the Community and on LinkedIn. Congratulations, Ahmed--thank you for being a SUPER user!  

Tuesday Tip: Getting Started with Private Messages & Macros

Welcome to TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   This Week's Tip: Private Messaging & Macros in Power Apps Community   Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member!   Our Knowledge Base article about private messaging and macros is the best place to find out more. Check it out today and discover some key tips and tricks when it comes to messages and macros:   Private Messaging: Learn how to enable private messages in your community profile and ensure you’re connected with other community membersMacros Explained: Discover the convenience of macros—prewritten text snippets that save time when posting in forums or sending private messagesCreating Macros: Follow simple steps to create your own macros for efficient communication within the Power Apps CommunityUsage Guide: Understand how to apply macros in posts and private messages, enhancing your interaction with the Community For detailed instructions and more information, visit the full page in your community today:Power Apps: Enabling Private Messaging & How to Use Macros (Power Apps)Power Automate: Enabling Private Messaging & How to Use Macros (Power Automate)  Copilot Studio: Enabling Private Messaging &How to Use Macros (Copilot Studio) Power Pages: Enabling Private Messaging & How to Use Macros (Power Pages)

Top Solution Authors
Top Kudoed Authors
Users online (4,509)