web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Changing data in galle...
Power Apps
Unanswered

Changing data in gallery based on the current user

(0) ShareShare
ReportReport
Posted on by 22

Hey! I am building this app that keeps record of your activity, but I have a problem. How do I change the completion of each activity in the gallery depending on the user and it doesn't show another persons info? I have a login page and it saves the current user in a variable(User) ex. person1.

The activities and the completions are in a excel sheet (there will be more users and activities). The usernames are the same in the activity sheet and the app

poweramateur_0-1708505014047.png

 

In short: How do I make the app change the completion of activities of the current user

 

Thanks in advance!

 

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @poweramateur a few suggestions:

     

    1. Change the layout of your Table. So that each person is displayed across rows and each activity is displayed across columns

    2. Use email addresses instead of user names. There is a better likelihood for email addresses to match what your organisation uses in active directory.

    3. You can then filter the Gallery based on the below expression:

    Filter(
     SampleExcelTable,
     Name = User().Email
    )

     

    4. Excel is a terrible data source. Consider moving your table to SharePoint or, if you have a premium licence, to Dataverse.

     

  • poweramateur Profile Picture
    22 on at

    @Amik Thanks for responding!

     

    I changed the activity list to share point, the layout and the filter. Now it only shows 1 of the activities even though there is more than 1. Also it doesn't tell witch activity it is showing (name of the column).

  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @poweramateur - could you share a screenshot of your table (if possible), as well as the code you have used.

  • poweramateur Profile Picture
    22 on at

    @Amik Sorry that it is in finnish. The rough translation Nimi = Name | Uinti = swimming | Juoksu = Running | Hiihto = ski | valmis = done | kesken = not done

    poweramateur_1-1708674469777.png

    poweramateur_2-1708674733168.png

     

  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @poweramateur - that screenshot does not look like an Excel sheet.

     

    Assuming your data source has now become SharePoint, and the "Nimi" field is a People data type, use:

     

    Filter(
     'Liikunta diplomi tehtavat';
     Nimi.Email = User().Email
    )
  • poweramateur Profile Picture
    22 on at

    @Amik  Because in the sharepoint 'Nimi' is just a persons full name and doesn't contain their email. Adding .email doesn't do anything, it just says that there is an error.

     

    Sorry for me still being a noob in power apps 🙂

  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @poweramateur - if you're not going to follow the suggestion and continue to populate the "Nimi" text field with display names, use:

     

    Filter(
     'Liikunta diplomi tehtavat';
     Nimi = User().FullName
    )

     

    Alternatively, replace your single line text field with a Person column. Because this column returns a record which can hold multiple attributes (including full name and email), you then have the option of to check for either attribute.

     

    For example, if you populate the Person column with names, you can then use:

     

    Filter(
     'Liikunta diplomi tehtavat';
     PeopleColumn.DisplayName = User().FullName
    )

     

    However, given the person column also stores each person's email address, it would be ideal to use:

     

    Filter(
     'Liikunta diplomi tehtavat';
     PeopleColumn.Email = User().Email
    )

     

    Further reading:

     

    https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/working-with-tables 

     

    https://support.microsoft.com/en-gb/office/list-and-library-column-types-and-options-0d8ddb7b-7dc7-414d-a283-ee9dca891df7 

  • poweramateur Profile Picture
    22 on at

    @Amik  I made it so it references to the email of the user and it shows only that users completion, but the current problem is that it only shows 1 activity. Would it work if I made a column for each person and is it possible to filter with the column name? 🤔

  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @poweramateur - If you return to your original structure (a column per person) - you will still be in the same position but in reverse.

     

    The answer depends on what you're ultimately trying to do. If I wanted to see which activities a person has been  involved in, I would personally duplicate the person per the number activities. E.g.:

     

    Amik_0-1708946602611.png

     

    If each activity is a set list which will be the same for each person, I would use the below structure:

     

    Amik_1-1708946640194.png

  • poweramateur Profile Picture
    22 on at

    @Amik yes that would work, but there is a slight problem: ultimately there will be in the range of 30 - 50 activities and the number of users is unknown. The activity list is something people can join if they want and it it impossible to know who is going to join this thing in advance.

    (I just used running, swimming and skiing as a example)

     

    Should I just abandon this project and just share a excel sheet of the activities to everyone who wants to join and return them to me when completed?

     

    Sorry about this

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 529 Most Valuable Professional

#2
Haque Profile Picture

Haque 230

#3
Kalathiya Profile Picture

Kalathiya 217 Super User 2026 Season 1

Last 30 days Overall leaderboard