cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sidhant_02
Post Prodigy
Post Prodigy

Display only non-blank values in a SharePoint list and to show data submitted by the current logged in user

Hi everyone,
I am being looking for a solution for my requirement but I have not found it for my queries which are as follows:
1:

I have created a Additional details form (which every user has to fill in when they login to the application {if they have not filled it}) which is:

Sidhant_02_0-1680502873596.png

And to save this details I have created a SharePoint list named AdditionalDetails (in Power apps it is named AdditionalDetails_1 after connecting it with my application)
Now once user fills the details they are navigated to Home page where in I have a provided a button to see the additional details that they have filled. I want to display the additional details of the user who is logged in
So for example: I have a LoginList (which stores all the credentials of all users for the app)
Lets say: Jimmy is a user in the List, so now if I login using Jimmy's credentials (Username: jim Pass: 1234) -> Fill the additional details form -> Submit it and Go to Home Page -> Navigate to Additional Details page: In this page I just want to show Jimmy's additional no other records (no blank values as well) {it should filter out based on Login List user credentials not by Office365 account details}

AdditionalDetails (Share Point list):

Sidhant_02_1-1680503242903.png


Login List:
Header: 

Sidhant_02_2-1680503331053.png

 

Sidhant_02_3-1680503350441.png



So I did try using Lookup function (inside ForAll) and tried comparing the Email field from the SharePoint List (AdditionalDetails_1) with the sharepoint list LoginList to check Email from both is matching for current logged user, but I was not getting the expected result:

Sidhant_02_5-1680503608124.png

 

Sidhant_02_4-1680503591303.png


As you can see in the above 2 images: I have logged in using Test user credentials (where the additional details are already filled in) but here I am able to see all additional details of other users as well  and some blank rows

Sidhant_02_6-1680503733648.png


To compare the values from 2 different sharepoint list (here I email) I have used '@' , through one post I came across:
Reference to check a value in two different sharepoint list 


Logic on the Gallery on ViewAdditional Details page. I did try using RemoveIf but that's not allowed (had referred: https://powerusers.microsoft.com/t5/Building-Power-Apps/How-do-I-delete-empty-rows-in-a-table-collec...) - it might be for collection.

Can anyone please help with this. I have created a detailed query for the same (the actual requirement that I have: 60% percent is completed, now only the last step is remaining) and this query is subset of the main query:
Main Query: Additional Details  

Also I have some queries that I have posted on Forum (for which I need answers as well), so do have a look at those as well, I have mentioned the links below:
1. Block User after few incorrect attempts 
2. Editing the Gallery on the go 

If you guys have time do check and reply: @WarrenBelz @KeithAtherton , @Ramole , @timl 

Regards,
Sidhant

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Sidhant_02 

 

Understand now, for the login action, Jimmy will only type his user name and Password. In this case, you need to re-create the User name variable instead of the “Email” variable exactly during the login step.

 

1.Go to the login button, add below formula exactly before you Reset the two textinput controls.

 

Navigate(Screen);     //example formula

Set(varUserName, TextInput1.Text);   //I guess it’s this “TextInput1” control, please change it if I am wrong

 

Reset(TextInput1);

Reset(TextInput2)

 

2.Change the Filter function in your AdditionalDetails Screen:

 

Filter(AdditionalDetails_1,Title = varUserName)

 

3.Also, remember to remove the old variable varEmail from your app.

 

Best Regards,

Hen Wang

View solution in original post

5 REPLIES 5

Hi @Sidhant_02 ,

 

For this issue, you don’t need to use the Forall function. If the email value inside these two lists are the same, then you can just use Filter function to find out the exact record related to the single user “Jimmy”.

 

I don’t know what is it inside your submit button of the AdditionalDetails_1 form, but if I were you, I will use patch function to patch the value Jimmy write into the AdditionalDetails_1 list when Jimmy is clicking on the submit button.

 

After this, you need to create a variable to store the email value written by Jimmy and then we can use this variable to compare and find out the only one existing record that belongs to Jimmy only.

 

Inside the login button, please add this formula at the end:

 

Set(varEmail,TextInput2_3.Text)    //please replace the textinput2_3 with your own textinput name.

 

HenWang_0-1680592443038.png

 

 

 

Then please change the items property of the gallery as below formula:

 

Filter(AdditionalDetails_1,Email = varEmail)

 

Then Jimmy will be able to see his own record.

 

Best Regards,

Hen Wang

Hi @HenWang ,
Thanks for the response. This is the code on Submit button of the Additional Details page:

Sidhant_02_0-1680594402500.png

Also I created the variable and used it which has the email value, in my case the textinput field in the additional details page is called 'eMail'

Sidhant_02_1-1680594497493.png


So on Login screen I added the line which you mentioned in your response

Sidhant_02_2-1680594546681.png


But for logging-in , I am using the Username (which is called as Title in the sharePoint list) to login in the application (not email)

Sidhant_02_3-1680594627059.png


And when I used the filter condition on the ViewAdditionalDetails page it is not displaying any result:

Sidhant_02_4-1680594838968.png
In the above image (I have logged in with Kimmy; in which I have given my email id still cannot see any result)

Sidhant_02_0-1680595082776.png

 

So is it because after the user fills the additional details, I am clearing out all the fields using Reset so it might get empty value in the variable (varCheck) that we have used on Login button (at end), because I need to clear all the values once the data is submitted in Additional Details form?

Regards,
Sidhant

Hi @Sidhant_02 

 

Understand now, for the login action, Jimmy will only type his user name and Password. In this case, you need to re-create the User name variable instead of the “Email” variable exactly during the login step.

 

1.Go to the login button, add below formula exactly before you Reset the two textinput controls.

 

Navigate(Screen);     //example formula

Set(varUserName, TextInput1.Text);   //I guess it’s this “TextInput1” control, please change it if I am wrong

 

Reset(TextInput1);

Reset(TextInput2)

 

2.Change the Filter function in your AdditionalDetails Screen:

 

Filter(AdditionalDetails_1,Title = varUserName)

 

3.Also, remember to remove the old variable varEmail from your app.

 

Best Regards,

Hen Wang

Thank you @HenWang ,
It is working now, I am able to see the additional details for the respective user.
Before: 

Sidhant_02_1-1680599081388.png


After:

Sidhant_02_0-1680599058446.png
Could you just let me know how to edit the records if a user wants to (on the above page)?.
And also if possible could you please have a look at my second query which was regarding to block a user for a time period if they enter incorrect details during login for security purpose and editing a Gallery on the Go, I have mentioned the links below.
1. Block User after Incorrect Attempts 
2. Editing the Gallery on the Go (This query was marked as solved by mistake it is still not solved. The solution that I have written was for some other query)
So if you could you have a look at the above 2 queries it would be helpful.

Once again Thanks for the quick response.

Regards,
Sidhant

Hi @HenWang ,
Scenario: 
Assume there are  two users in my application 
Sam : Admin            Mary: Employee
So now that we added a Filter condition to show Additional data to current logged in user by using a variable on the login page (the solution which you gave).
Assume that Sam (administrator: Role) logins in the application then he must be able to view all the records and even can edit them:

Sidhant_02_0-1682504411033.png

So now if I want the admin to see all the records (and even give the permission to edit), so should I create a duplicate of the page and in Items property directly give the SharePoint List name: AdditionalDetails_1

Sidhant_02_1-1682504696113.png

Wanted to show all the records (Additional details) to the Administrator: User Role in the above format. Do let me know is it correct or any corrections are required?.

Regards,
Sidhant

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!   This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions in the Forums to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersNumber of SolutionsSuper UsersNumber of Solutions @anandm08  23 @WarrenBelz  31 @DBO_DV  10 @Amik  19 AmínAA 6 @mmbr1606  12 @rzuber  4 @happyume  7 @Giraldoj  3@ANB 6 (tie)   @SpongYe  6 (tie)     Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersSolutionsSuper UsersSolutions @anandm08  10@WarrenBelz 25 @DBO_DV  6@mmbr1606 14 @AmínAA 4 @Amik  12 @royg  3 @ANB  10 @AllanDeCastro  2 @SunilPashikanti  5 @Michaelfp  2 @FLMike  5 @eduardo_izzo  2   Meekou 2   @rzuber  2   @Velegandla  2     @PowerPlatform-P  2   @Micaiah  2     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 3:Community MembersSolutionsSuper UsersSolutionsPower Apps anandm0861WarrenBelz86DBO_DV25Amik66Michaelfp13mmbr160647Giraldoj13FLMike31AmínAA13SpongYe27     Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 4:Community MembersSolutionsSuper UsersSolutionsPower Apps DBO-DV21WarranBelz26Giraldoj7mmbr160618Muzammmil_0695067Amik14samfawzi_acml6FLMike12tzuber6ANB8   SunilPashikanti8

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (472)