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 / Control content presen...
Power Apps
Unanswered

Control content presented within gallery with different buttons

(0) ShareShare
ReportReport
Posted on by

Hello,

 

Here is my scenario.

 

I have 3 buttons that I want to manipulate a single gallery. The gallery is a SharePoint list.

 

The buttons are as follows:

 

  • Button1 = Show "all" items within the gallery.
  • Button2 = Show only "new" items created in the last month.
  • Button 3 = Show only "not viewed" items. Basically, an item in the gallery is marked as "viewed" if the users profile name is in the "User" created column in the SharePoint list.
  • Search button= search gallery. Search items name & short description.

 

filter1.jpg

 

 

Also, each Item in the SharePoint list is assigned to a particular "category" column. I have left and right arrows to cycle through the different categories (category1, category2, category3, etc. I want to have the gallery show only the items belonging to those categories.

 

nav1.jpg

 

 

Options and examples would be much appreciated.

 

Thanks in advance.

Categories:
I have the same question (0)
  • Giraldoj Profile Picture
    997 Super User 2026 Season 2 on at

    Hi @ShadowTech 

    To control the content presented within your gallery using different buttons, you can create a dynamic filter system. 

    Start by creating a variable to hold the current filter. This will help you switch between different filters based on which button is clicked.

    Define the Filter Variable: Create a variable called currentFilter.

    then change the onSelect action of each Button

    Button1: set(currentFilter, "All" )
    Button2: set(currentFilter, "New").
    Button3: set(currentFilter, "NotViewed" )

    Search Button: 'Filter(YourSharePointList, StartsWith(Title, txtSearch.Text) || StartsWith(ShortDescription, txtSearch.Text))' (Assuming you have a TextInput control for search named 'txtSearch')

    Update the gallery’s items property to check the value of currentFilter and apply the appropriate filter.

    it should look something like this


    If(
    currentFilter = "All",
    YourSharePointList,
    currentFilter = "New",
    Filter(YourSharePointList, Created >= DateAdd(Today(), -1, Months)),
    currentFilter = "NotViewed",
    Filter(YourSharePointList, Not(User() in 'User Column')),
    currentFilter = "Search",
    Filter(YourSharePointList, StartsWith(Title, txtSearch.Text) || StartsWith(ShortDescription, txtSearch.Text)),
    YourSharePointList // Default to showing all if no filter is set
    )


    You can also put the whole fiter in the variable and change it when you press a button. like


    Button2: When clicked, set(currentFilter,Filter(YourSharePointList, Created >= DateAdd(Today(), -1, Months)))


    For the Category Navigation ill need more detail about which control you are using to change the category, it can affect the code but ill give you an idea you can try


    Initialize a variable for the current category (or leave it empty by default). For example, Set(currentCategory, "Category1").

    Use the left arrow to cycle to the previous category and the right arrow to cycle to the next category. You can update the category like this:


    Left Arrow OnSelect: Set(currentCategory, Switch(currentCategory, "Category1", "Category3", "Category2", "Category1", "Category3", "Category2"))

    Right Arrow OnSelect: Set(currentCategory, Switch(currentCategory, "Category1", "Category2", "Category2", "Category3", "Category3", "Category1"))


    Update the gallery’s items property to include the current category filter:
    Filter(YourSharePointList, Category = currentCategory)


    I hope this is clear enough, If you have any questions or feedback, please let me know. 😁!

  • ShadowTech Profile Picture
    on at

    @Giraldoj 

     

    These are the errors I'm seeing when entering the gallery formula for the buttons and search. It doesn't seem to like some of it. Suggestions?

     Also, the category buttons don't switch. Actually, the gallery shows all items not associated with those categories.

     

    The "Employees who have completed curriculum is a choice column as is "Category" column.

    errors.jpg

  • Giraldoj Profile Picture
    997 Super User 2026 Season 2 on at

    Hi @ShadowTech 

    I apologize for the errors in my previous responses. Below, you’ll find the corrected information. I’ve also replicated the filters in my environment to ensure the accuracy of the codes. Please adjust them according to the specific names of the items in your data source.

    For context,With the following code I’m creating a collection in the OnStart property of the application to mimic your data source:

    ClearCollect(
        'Employee Training',
       Table(
        {Created: Date(2024,01,15), Title: "Curso 1", course_description: "Descripción Curso 1", Used: false, User: "usuario_pwp@hiberusspo365demo.onmicrosoft.com", Category: "Category1"},
        {Created: Date(2024,02,20), Title: "Curso 2", course_description: "Descripción Curso 2", Used: true, User: "usuario_generico1@ejemplo.com", Category: "Category2"},
        {Created: Date(2024,03,10), Title: "Curso 3", course_description: "Descripción Curso 3", Used: false, User: "usuario_generico2@ejemplo.com", Category: "Category3"},
        {Created: Date(2024,04,25), Title: "Curso 4", course_description: "Descripción Curso 4", Used: true, User: "usuario_generico3@ejemplo.com", Category: "Category1"},
        {Created: Date(2024,05,15), Title: "Curso 5", course_description: "Descripción Curso 5", Used: false, User: "usuario_generico4@ejemplo.com", Category: "Category2"},
        {Created: Date(2024,06,20), Title: "Curso 6", course_description: "Descripción Curso 6", Used: true, User: "usuario_generico5@ejemplo.com", Category: "Category3"},
        {Created: Date(2024,07,10), Title: "Curso 7", course_description: "Descripción Curso 7", Used: false, User: "usuario_generico6@ejemplo.com", Category: "Category1"},
        {Created: Date(2024,08,25), Title: "Curso 8", course_description: "Descripción Curso 8", Used: true, User: "usuario_generico7@ejemplo.com", Category: "Category2"},
        {Created: Date(2024,09,15), Title: "Curso 9", course_description: "Descripción Curso 9", Used: false, User: "usuario_generico8@ejemplo.com", Category: "Category3"},
        {Created: Date(2024,10,20), Title: "Curso 10", course_description: "Descripción Curso 10", Used: true, User: "usuario_generico9@ejemplo.com", Category: "Category1"},
        {Created: Date(2024,11,10), Title: "Curso 11", course_description: "Descripción Curso 11", Used: false, User: "usuario_generico10@ejemplo.com", Category: "Category2"},
        {Created: Date(2024,12,25), Title: "Curso 12", course_description: "Descripción Curso 12", Used: true, User: "usuario_generico11@ejemplo.com", Category: "Category3"},
        {Created: Date(2024,01,20), Title: "Curso 13", course_description: "Descripción Curso 13", Used: false, User: "usuario_generico12@ejemplo.com", Category: "Category1"},
        {Created: Date(2024,02,10), Title: "Curso 14", course_description: "Descripción Curso 14", Used: true, User: "usuario_generico13@ejemplo.com", Category: "Category2"},
        {Created: Date(2024,03,25), Title: "Curso 15", course_description: "Descripción Curso 15", Used: false, User: "usuario_generico14@ejemplo.com", Category: "Category3"},
        {Created: Date(2024,04,15), Title: "Curso 16", course_description: "Descripción Curso 16", Used: true, User: "usuario_generico15@ejemplo.com", Category: "Category1"},
        {Created: Date(2024,05,20), Title: "Curso 17", course_description: "Descripción Curso 17", Used: false, User: "usuario_generico16@ejemplo.com", Category: "Category2"},
        {Created: Date(2024,06,10), Title: "Curso 18", course_description: "Descripción Curso 18", Used: true, User: "usuario_generico17@ejemplo.com", Category: "Category3"},
        {Created: Date(2024,07,25), Title: "Curso 19", course_description: "Descripción Curso 19", Used: false, User: "usuario_generico18@ejemplo.com", Category: "Category1"},
        {Created: Date(2024,08,15), Title: "Curso 20", course_description: "Descripción Curso 20", Used: true, User: "usuario_generico19@ejemplo.com", Category: "Category2"}
    )

    );
    Set(
        currentCategory,
        "Category1"
    )
    Also im defining a Default Category, Now lets start with the bottons 

    Button All: Set(currentFilter, "All" )
    Button New: Set(currentFilter, "New")
    Button Not Started: Set(currentFilter, "NotViewed" )
    Button Search (loop): Set(currentFilter, "Search")

    Gallery items Property:

    If(
        currentFilter = "All",
        Filter('Employee Training', Category = currentCategory),

        currentFilter = "New",
        Filter(Filter('Employee Training', Created >= DateAdd(Today(), -1, TimeUnit.Months)), Category = currentCategory),

        currentFilter = "NotViewed",
        Filter(Filter('Employee Training', Not(User().Email in User)), Category = currentCategory),

        currentFilter = "Search",
        Filter(Filter('Employee Training', StartsWith(Title, txtSearch.Value) || StartsWith(course_description, txtSearch.Value)), Category = currentCategory),
       
        Filter('Employee Training', Category = currentCategory) // Default to showing all if no filter is set
    )

    and finally the arrows 

    Right arrow: Set(currentCategory, Switch(currentCategory, "Category1", "Category2", "Category2", "Category3", "Category3", "Category1"))
     
    Left Arrow: Set(currentCategory, Switch(currentCategory, "Category1", "Category3", "Category2", "Category1", "Category3", "Category2"))
     
    Category text field:  currentCategory
    Grabación 2024-06-22 025550.gif
  • ShadowTech Profile Picture
    on at

    @Giraldoj 

     

    Hello,

     

    Below is what I'm seeing now. I did make a couple changes. Let me know if you agree. And I think I was not so clear about the user profiles for the not started. I need the app/screen to look at the users profile name that accesses the app and if their name is not in the "Employees who have completed curriculum" column, then it will show that Item for "Not Started". So the "Not Started" button should show only items that don't have the users profile name in that column.

     

    I hope this makes more sense.

     

    1. Replaced ".Value" to Category as this Column is a choice column.

    2. Replaced ".Value" for the text box with ".Text" as this is a text field.

    Bar.jpg

     

     

    For some reason I'm getting an error for "User". 

     

    error_output.jpg

     

    Also, can you explain the syntax for the categories of the arrow buttons? I'm a bit confused with the Category1, category2, category2, category3, category3.

     And what's the best way to integrate the syntax below as it will filter the gallery by "Title".

     

     

    (Filter([@'Employee Training'], Title = "TrulinX Training")

     

     

    Thanks again.

     

  • Giraldoj Profile Picture
    997 Super User 2026 Season 2 on at

    Hi @ShadowTech 

     

    Thanks for the additional details. If you want to filter the records where the user is not equal to the current user by clicking the "Not Started" button, you can use the following formula:

    currentFilter = "NotViewed",
    Filter('Employee Training', User().FullName <> User, Category = currentCategory)

    This formula might differ based on the data type of the User attribute in your table. If User is a record, you should use User.Name, for example.

    If the previous formula doesn't work, please hover your mouse over the error to display the details so I can better understand how to correct the filtering based on the data type of the User column.


    Now, the Switch function in Power Fx works by pairing each case with a result. Here’s the sequence:


    Set(currentCategory, Switch(currentCategory, "Category1", "Category2", "Category2", "Category3", "Category3", "Category1"))

    What that Switch function does is basically the following:

    If currentCategory is "Category1", it sets currentCategory to "Category2".
    If currentCategory is "Category2", it sets currentCategory to "Category3".
    If currentCategory is "Category3", it sets currentCategory to "Category1".

    You can find more information about the Switch function here.

    https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-if

    Whether the Switch function is a match for your requirement depends on the details about your categories. Please provide more detail so we can find a better approach.

    Now integrating  the additional filter totally depends on what you want to acheive, if that title is going to be dynamic or is always going to be the same, if is static so you can just adjust your items gallery property by additing and additional OR on each filter case, something like

    If(
    currentFilter = "All",
    Filter('Employee Training', Category = currentCategory || Title = "TrulinX Training"),

    currentFilter = "New",
    Filter(Filter('Employee Training', Created >= DateAdd(Today(), -1, TimeUnit.Months) || Title = "TrulinX Training"), Category = currentCategory),

    currentFilter = "NotViewed",
    Filter(Filter('Employee Training', User().FullName <> User || Title = "TrulinX Training"), Category = currentCategory),

    currentFilter = "Search",
    Filter(Filter('Employee Training', StartsWith(Title, txtSearch.Value) || StartsWith(course_description, txtSearch.Value) || Title = "TrulinX Training"), Category = currentCategory),

    Filter('Employee Training', Category = currentCategory || Title = "TrulinX Training") // Default to showing all if no filter is set
    )

  • ShadowTech Profile Picture
    on at

    @Giraldoj 

     

    First off, let me say thank you for your assistance thus far. This is what's not showing for me so far.

     

    I made a couple changes and have a couple questions.

     

     

    If(
    currentFilter = "All",
    Filter('Employee Training', Category.Value = currentCategory || Title = "TrulinX Training"),
    
    currentFilter = "New",
    Filter(Filter('Employee Training', Created >= DateAdd(Today(), -1, TimeUnit.Months) || Title = "TrulinX Training"), Category.Value = currentCategory),
    
    currentFilter = "Not Started",
    Filter(Filter('Employee Training', User().FullName in 'Employees who have completed curriculum'.DisplayName || Title = "TrulinX Training"), Category.Value = currentCategory),
    
    currentFilter = "Search",
    Filter(Filter('Employee Training', StartsWith(Title, TextInput1_1.Text) || StartsWith('Course description', TextInput1_1.Text) || Title = "TrulinX Training"), Category.Value = currentCategory),
    
    Filter('Employee Training', Category.Value = currentCategory || Title = "TrulinX Training") // Default to showing all if no filter is set
    )

     

     

    1. The "new" Button is not showing any new items added in the last month. When clicking the button, the gallery goes blank. Not sure what's going on there.

    2. The "Not Started" button does not show just the items that DO NOT have the current users name in the "Employees who have completed curriculum" column in the SharePoint list. It just shows every item in the list. So basically, if the current users name is in the "Employees who have completed curriculum" people's column, then the gallery should NOT be showing those items.

    3. The Search button should be pointing to the textbox correct? In this case, TextInput1_1.text.

    4. The items are not changing per the categories. There are currently 13 different categories for this gallery.

     

    Thanks again.

  • Giraldoj Profile Picture
    997 Super User 2026 Season 2 on at

    Hi @ShadowTech 

     

    I'm glad that my previous answer was useful. Let's now clarify a few points.

    1. For the new button:
    The logic depends a lot on your column data type or format. Try displaying the date in a label first to identify what kind of date you are extracting from SharePoint.

    Sometimes you need to transform the date before making any comparisons. For example, if you have a date stored in a text field, you can use DateValue to convert a string to a date. In my example, Created is a date column, and the formula below is working just fine:

     currentFilter = "New",
     Filter(
     Filter(
     'Employee Training',
     Created >= DateAdd(
     Today(),
     -1,
     TimeUnit.Months
     ) || Title = "TrulinX Training"
     ),
     Category = currentCategory
     ),

    2. The "Not Started" Button:
    The code you have for the "Not Started" button is incorrect. In my last response, I made a small change by using a different operator (<>) to filter all names different from the current user's name.

    Again, I cannot give you the exact formula because I don't know the properties of your people column. A good approach could be displaying the value in a label to figure out the property name where the full name is stored. Additionally, keep in mind that the full name in SharePoint might not be the same as in Dataverse.

    I just changed the formula of the filter to show you how you should apply the filter if your column has for example a property called DisplayName, in this case my table column name is User, its an object an im using the DisplayName property:

     currentFilter = "NotViewed",
     Filter(
     Filter(
     'Employee Training',
     User().FullName <> User.DisplayName
     ),
     Category = currentCategory
     ),

     

    3.The Search Button:
    That's correct. In my previous response, I used the modern controls, which is why I referenced TextInput1_1.Value. However, if you are using the older controls, your formula should look something like the sample below.

    Additionally, your formula depends on the outcome you want to achieve. In my previous example, we used the StartsWith function, which checks just the start of your string. If you want to check the input value within the entire text, you should use the Search function instead. The Search function allows you to search for the keyword in any place across several columns simultaneously. The formula should look something like this:

     currentFilter = "Search",
     Filter(
     Search(
     'Employee Training',
     TextInput1_1.Text,
     Title,
     course_description
     ),
     Category = currentCategory
     ),

    4. Categories:
    Pretty much the same. I'm just giving you an example based on the information you provided; it may or may not work depending on your exact requirements. If you have 13 categories, my previous answer might be cumbersome. So, instead of using that complex Switch function, let's try something different.

    If you have a table, array, or collection with your categories, and your categories have an ID or index, you can take a different approach.

    I started by creating my entire categories table:

    ClearCollect(
     Categories,
     Table(
     {Index: 1, Category: "Category1"},
     {Index: 2, Category: "Category2"},
     {Index: 3, Category: "Category3"},
     {Index: 4, Category: "Category4"},
     {Index: 5, Category: "Category5"},
     {Index: 6, Category: "Category6"},
     {Index: 7, Category: "Category7"},
     {Index: 8, Category: "Category8"},
     {Index: 9, Category: "Category9"},
     {Index: 10, Category: "Category10"},
     {Index: 11, Category: "Category11"},
     {Index: 12, Category: "Category12"},
     {Index: 13, Category: "Category13"}
     )
    );
    
    Set(currentCategoryIndex, 1);
    Set(currentCategory, LookUp(Categories, Index = currentCategoryIndex).Category)

    In this case i have created a table of categories and each category has an index that will help to navigate with the arrow buttons

    this is the code for the right button:

    Set(currentCategoryIndex, If(currentCategoryIndex < CountRows(Categories), currentCategoryIndex + 1, 1));
    Set(currentCategory, LookUp(Categories, Index = currentCategoryIndex).Category)

    and this one is for the left button:

    Set(currentCategoryIndex, If(currentCategoryIndex > 1, currentCategoryIndex - 1, CountRows(Categories)));
    Set(currentCategory, LookUp(Categories, Index = currentCategoryIndex).Category)

    This aproach is much better because you can add infinite categories without changing the arrows code.


    And finally this is my on start code so you can understand how im builing everything to be as similar as your case as possible, maybe it will help you to understand the logic of the filter:

    ClearCollect(
     'Employee Training',
     Table(
     {
     Created: Date(2024, 06, 15),
     Title: "Course 1",
     course_description: "Introduction to Power Apps and its basic functionalities.",
     Used: false,
     User: {
     UserEmail: "usuario_pwp@hiberusspo365demo.onmicrosoft.com",
     DisplayName: "PWP Prototype"
     },
     Category: "Category 1"
     },
     {
     Created: Date(2024, 05, 20),
     Title: "Course 2",
     course_description: "Advanced SharePoint integration techniques.",
     Used: true,
     User: {
     UserEmail: "usuario_generico1@ejemplo.com",
     DisplayName: "Generic User 1"
     },
     Category: "Category 2"
     },
     {
     Created: Date(2024, 04, 10),
     Title: "Course 3",
     course_description: "Building custom connectors in Power Apps.",
     Used: false,
     User: {
     UserEmail: "usuario_generico2@ejemplo.com",
     DisplayName: "Generic User 2"
     },
     Category: "Category 3"
     },
     {
     Created: Date(2024, 03, 25),
     Title: "Course 4",
     course_description: "Understanding Power Automate workflows.",
     Used: true,
     User: {
     UserEmail: "usuario_generico3@ejemplo.com",
     DisplayName: "Generic User 3"
     },
     Category: "Category 4"
     },
     {
     Created: Date(2024, 05, 15),
     Title: "Course 5",
     course_description: "Creating responsive designs in Power Apps.",
     Used: false,
     User: {
     UserEmail: "usuario_generico4@ejemplo.com",
     DisplayName: "Generic User 4"
     },
     Category: "Category 5"
     },
     {
     Created: Date(2024, 02, 20),
     Title: "Course 6",
     course_description: "Using Dataverse for data management.",
     Used: true,
     User: {
     UserEmail: "usuario_generico5@ejemplo.com",
     DisplayName: "Generic User 5"
     },
     Category: "Category 6"
     },
     {
     Created: Date(2024, 07, 10),
     Title: "Course 7",
     course_description: "Securing your Power Apps environment.",
     Used: false,
     User: {
     UserEmail: "usuario_generico6@ejemplo.com",
     DisplayName: "Generic User 6"
     },
     Category: "Category 7"
     },
     {
     Created: Date(2024, 08, 05),
     Title: "Course 8",
     course_description: "Best practices for Power BI integration.",
     Used: true,
     User: {
     UserEmail: "usuario_generico7@ejemplo.com",
     DisplayName: "Generic User 7"
     },
     Category: "Category 8"
     },
     {
     Created: Date(2024, 09, 01),
     Title: "Course 9",
     course_description: "Automating tasks with AI Builder.",
     Used: false,
     User: {
     UserEmail: "usuario_generico8@ejemplo.com",
     DisplayName: "Generic User 8"
     },
     Category: "Category 9"
     },
     {
     Created: Date(2024, 06, 20),
     Title: "Course 10",
     course_description: "Introduction to Power Platform governance.",
     Used: true,
     User: {
     UserEmail: "usuario_generico9@ejemplo.com",
     DisplayName: "Generic User 9"
     },
     Category: "Category 10"
     },
     {
     Created: Date(2024, 05, 30),
     Title: "Course 11",
     course_description: "Creating user-friendly interfaces.",
     Used: false,
     User: {
     UserEmail: "usuario_generico10@ejemplo.com",
     DisplayName: "Generic User 10"
     },
     Category: "Category 11"
     },
     {
     Created: Date(2024, 04, 25),
     Title: "Course 12",
     course_description: "Integrating with external data sources.",
     Used: true,
     User: {
     UserEmail: "usuario_generico11@ejemplo.com",
     DisplayName: "Generic User 11"
     },
     Category: "Category 12"
     },
     {
     Created: Date(2024, 03, 10),
     Title: "Course 13",
     course_description: "Deploying solutions in Power Apps.",
     Used: false,
     User: {
     UserEmail: "usuario_generico12@ejemplo.com",
     DisplayName: "Generic User 12"
     },
     Category: "Category 13"
     },
     {
     Created: Date(2024, 02, 10),
     Title: "Course 14",
     course_description: "Managing Power Apps environments.",
     Used: true,
     User: {
     UserEmail: "usuario_generico13@ejemplo.com",
     DisplayName: "Generic User 13"
     },
     Category: "Category 1"
     },
     {
     Created: Date(2024, 01, 25),
     Title: "Course 15",
     course_description: "Advanced customizations in Power Apps.",
     Used: false,
     User: {
     UserEmail: "usuario_generico14@ejemplo.com",
     DisplayName: "Generic User 14"
     },
     Category: "Category 2"
     },
     {
     Created: Date(2024, 04, 15),
     Title: "Course 16",
     course_description: "Understanding Power Apps licensing.",
     Used: true,
     User: {
     UserEmail: "usuario_generico15@ejemplo.com",
     DisplayName: "Generic User 15"
     },
     Category: "Category 3"
     },
     {
     Created: Date(2024, 05, 20),
     Title: "Course 17",
     course_description: "Creating efficient workflows.",
     Used: false,
     User: {
     UserEmail: "usuario_generico16@ejemplo.com",
     DisplayName: "Generic User 16"
     },
     Category: "Category 4"
     },
     {
     Created: Date(2024, 06, 10),
     Title: "Course 18",
     course_description: "Using templates for quick development.",
     Used: true,
     User: {
     UserEmail: "usuario_generico17@ejemplo.com",
     DisplayName: "Generic User 17"
     },
     Category: "Category 5"
     },
     {
     Created: Date(2024, 07, 25),
     Title: "Course 19",
     course_description: "Exploring Power Apps mobile capabilities.",
     Used: false,
     User: {
     UserEmail: "usuario_generico18@ejemplo.com",
     DisplayName: "Generic User 18"
     },
     Category: "Category 6"
     },
     {
     Created: Date(2024, 08, 15),
     Title: "Course 20",
     course_description: "Integrating Power Apps with Teams.",
     Used: true,
     User: {
     UserEmail: "usuario_generico19@ejemplo.com",
     DisplayName: "Generic User 19"
     },
     Category: "Category 7"
     }
     )
    );
    
    ClearCollect(
     Categories,
     Table(
     {Index: 1, Category: "Category 1"},
     {Index: 2, Category: "Category 2"},
     {Index: 3, Category: "Category 3"},
     {Index: 4, Category: "Category 4"},
     {Index: 5, Category: "Category 5"},
     {Index: 6, Category: "Category 6"},
     {Index: 7, Category: "Category 7"},
     {Index: 8, Category: "Category 8"},
     {Index: 9, Category: "Category 9"},
     {Index: 10, Category: "Category 10"},
     {Index: 11, Category: "Category 11"},
     {Index: 12, Category: "Category 12"},
     {Index: 13, Category: "Category 13"}
     )
    );
    
    Set(currentCategoryIndex, 1);
    Set(currentCategory, LookUp(Categories, Index = currentCategoryIndex).Category)



    If my response resolved your issue, please feel free to mark it as the solution by clicking "Accept as solution." This helps others find the answer more easily. If you found the content helpful in any other way, a "Thumbs Up" would be greatly appreciated. Thank you! 😁

    Grabación de pantalla 2024-06-30 012911.gif
  • ShadowTech Profile Picture
    on at

    @Giraldoj 

     

    A couple questions:

     

    1. Shouldn't the Executed code for the "Not Started" button look into a selected column in the SharePoint list for reference? Because I don't see that in your formula. The Column in Question is called "Completed Users" which is a basic People column which allows multiple choices (Users names). Not sure if that is messing things up. My experience in the past Indicated that it does support .displayname. It for some reason does not like the "<> User.Displayname". And do you think it would make more sense to use the Office365.Users.MyProfile instead of just "User" here. Just wondering since the People column does utilize Office365 net.

     

    2. The "Category" Column is a choice column so I'm Using the .Value at the end, otherwise it won't take it.

     

    3. Ok, the "New" button is working. Just wasn't seeing anything due to the categories.

  • Giraldoj Profile Picture
    997 Super User 2026 Season 2 on at

    Hi @ShadowTech 

     

    1. Oh yes you are correct in my sample formula "User.DisplayName" is the name of my datasource column and the name property, in your datasource can be "Completed Users.DisplayName" or any attribute you are able to extract from data people column.

    Regarding to use User.Displayname or Office365.Users.MyProfile that depends a lot on your set up, for example if your Power Platform environment is connected and synchronized with Azure AD or Office365 both formulas should give you the same outcome.

    but if your Power Platform environment is not connected to Azure. Names in systemuser tables could be different and will be more effective to use Office365Users.MyProfile().DisplayName

    do some testing, check which one has the same name that your datasoruce column, in my case User().FullName is the match

    Giraldoj_0-1719964247908.png

    You will need to figure out that part because i cannot replicate your exact SharePoint and Office 365 structure 😅

     

    2. If "Category" its a choice column, you need to perform some additional steps, It took me some time to figure out how to do it but here it is.

    You can use the Choices function to get the possible values for the choice column and then cycle through them. Here's an example of how to do it:


    first you need to include this in your onload, to create an array with all the choices and assign them and Index so we can increase the category later.

     

    Set(categoryChoices, Choices('Category (Ventas)'));
    Set(currentCategoryIndex, 1);
    Set(currentCategory, First(categoryChoices).Value);

     

     

    Now your right arrow code should change to 

     

    Set(currentCategoryIndex, If(currentCategoryIndex < CountRows(categoryChoices), currentCategoryIndex + 1, 1));
    Set(currentCategory, First(LastN(categoryChoices, currentCategoryIndex)).Value);

     

     

    And your left arrow to

     

    Set(currentCategoryIndex, If(currentCategoryIndex > 1, currentCategoryIndex - 1, CountRows(categoryChoices)));
    Set(currentCategory, First(LastN(categoryChoices, currentCategoryIndex)).Value);

     

     

    And now filters should be 

    Category = currentCategory or Category.Value = currentCategory depending of your datasource.

    3. Wonderfull!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 379 Most Valuable Professional

#2
11manish Profile Picture

11manish 203 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard