cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BenGillard
Helper III
Helper III

Collection Help

I have a collection created as follows:

ClearCollect(ExportData,Gallery1_1.AllItems);
ClearCollect(FilteredExportData,ShowColumns(ExportData,"Employee_Name_Picker","Role","Date_Start","Date_Expire","Label1_16"))

The collection shown below:

PowerApps Help.jpg

How can I get away from having the tables embedded in the collection. One if these is a people column so i just want the .DisplayName part to be shown as a text value in the table above.

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
rsaikrishna
Community Champion
Community Champion

@BenGillard 

 

I agree with @mdevaney 

 

You can also try the following:

ClearCollect(ExportData, ForAll(Gallery1_1.AllItems, {EmployeeName: Employee_Name_Picker.DisplayName}))

 

Note: Add all required columns to the collection.

 

There are multiple ways you can achieve it.

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

View solution in original post

4 REPLIES 4
mdevaney
Super User
Super User

@BenGillard 
My suggestion would be to set the AllowMultipleSelections property of the Employee_Name_Picker ComboBox to false

false


Then you must create a new column "EmployeeName" and extract the user's name to it.  Finally, show the EmployeeName column instead of Employee_Name_Picker like this.

ClearCollect(ExportData,Gallery1_1.AllItems);
ClearCollect(FilteredExportData,
    ShowColumns(
        AddColumns(
            ExportData,
            "EmployeeName",
            Employee_Name_Picker.DisplayName
        )
        "EmployeeName","Role","Date_Start","Date_Expire","Label1_16"
    )
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

rsaikrishna
Community Champion
Community Champion

@BenGillard 

 

I agree with @mdevaney 

 

You can also try the following:

ClearCollect(ExportData, ForAll(Gallery1_1.AllItems, {EmployeeName: Employee_Name_Picker.DisplayName}))

 

Note: Add all required columns to the collection.

 

There are multiple ways you can achieve it.

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

@rsaikrishna 

While I agree that your code would have the effect of adding the EmployeeName column it is not removing the 'extra' columns the original poster does not require.  I believe you should be adding ShowColumns to your code like this.

 

ClearCollect(
    ExportData,
    ShowColumns(
        ForAll(Gallery1_1.AllItems, {EmployeeName: Employee_Name_Picker.DisplayName}),
       "EmployeeName","Role","Date_Start","Date_Expire","Label1_16"
    )
)


---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

For some reason the AddColumn function did not work for me, hence the acceptance of the other solution. I am sure i could have got it to work this way also so thanks all 🙂

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,005)