cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cmanning
Super User
Super User

Gallery's Items Code - Need to Update it to Retrieve Additional Data

I have a canvas app with a gallery that is populated from the AssignedUsers table (see below).  When a user is added to a deal, this table stores the unique Deal ID, Assigned User's Full Name, Assigned User's Email, etc. in the AssignedUsers's table.
AssignedUsers select columns.png
The items property is shown below and works as expected.  However, the Result has the User's Full Name but NOT the Assigned User's Email.  How would I update this code to have access to the Assigned-Email as well?

 

// Items 
Sort(
    Distinct(
        Filter(
            AssignedUserss,
            'Role-Assigned' = dropdownAssignedRole.SelectedText.cr4de_role 
        ),
        'Assigned-Full-Name'
    ),
    Result,
    Ascending
)

 

Here is another view of the code and the results.

DV DIApp ASSIGN - Utilization gallery ITEMS code w preview.png

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @cmanning ,

 

Using Distinct function will generate a single column (Result) table.

 

I assume that one name is coordinating to only one Email, then you can use the GroupBy function:

Sort(
    GroupBy(
        Filter(
            AssignedUserss,
            'Role-Assigned' = dropdownAssignedRole.Selected.cr4de_role 
        ),
        "Assigned-Full-Name",
        "Assigned-Email",
        "Grouped"
    ),
    'Assigned-Full-Name',
    Ascending
)

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

4 REPLIES 4
v-jefferni
Community Support
Community Support

Hi @cmanning ,

 

Using Distinct function will generate a single column (Result) table.

 

I assume that one name is coordinating to only one Email, then you can use the GroupBy function:

Sort(
    GroupBy(
        Filter(
            AssignedUserss,
            'Role-Assigned' = dropdownAssignedRole.Selected.cr4de_role 
        ),
        "Assigned-Full-Name",
        "Assigned-Email",
        "Grouped"
    ),
    'Assigned-Full-Name',
    Ascending
)

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

@v-jefferni - Thanks for the response!  After replacing the gallery's Items property code with yours, I got this error.  Any recommendations? 

DV DI App ERR - Items Gallery ASSIGN.png
Here is the error details tab.
DV DI App ERR - Items Gallery ASSIGN details.png

Hi @cmanning ,

 

It seems like the second 'Assigned-Full-Name' is incorrect, please try and type in manually on your end.

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Thank you @v-jefferni for the solution!  Here is the final code. 

// Gallery Items
Sort(
    GroupBy(
        Filter(
            AssignedUserss,
            'Role-Assigned' = dropdownAssignedRole.SelectedText.Role
        ),
        "cr4de_assignedfullname",
        "cr4de_assignedemail",
        "Grouped"
    ),
    cr4de_assignedfullname,
    Ascending
)

 Using GroupBy eliminated the need for using Distinct right? 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,844)