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 / How to use Collect fun...
Power Apps
Answered

How to use Collect function to collect complex data type (string multiline)

(0) ShareShare
ReportReport
Posted on by 8

Hi there,  

 

Is there any way to set multiline data type (string multiline) in a powerapps collection so that these can be collected as a regular string and not through tables?

 

I use the office 365 user connector to filter my Office user gallery based on their skills which is a complex data (string multiline).

I’ve attempted to collect their skills into a collection and then use that collection in a combo box to filter my user gallery.

 

The Clearcollect function I’ve called worked quite well (ClearCollect(CollUserskills; {UserSkills:GalleryUsers.AllItems.LabelUserskills}) but I can’t reuse this collection in a combox because of the way skill data has been collected into my collection.

 

Do you have any idea how I can work around this problem?

powerapps Screenshot.jpg
Categories:
  • sayyed007amir Profile Picture
    357 on at

    Some suggestions:
    1. Click on table in collection and see what property it is showing, same you can use.

    2. While collecting data try to collect with Last, First functions.
    Can you try with adding

    .Value or .Name 

    in last. 
    If not solved then please more specify your issue with more screenshots and code.
    Thanks

  • Makerapps Profile Picture
    8 on at

    Hi sayyed007ami,

     

    Thanks for your tip, using first function helped me a bit to come closer to the result that I looking for but not exactly.

     

    I aim at letting my app user to filter by skills (using a combobox) a gallery I used to display o365 users.

     

    To do that I though about collecting all users'skills display in my gallery and then user that collection in a combobox to filter my user gallery.

     

    So far I've faced issues to collect all my users'skills in a collection at once. On top of that, user'skills are stored in a multiline fields.

     

    Do you know any alternate to get all user'skills in a collection and than use this collection in a combobox?

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Makerapps :

    Do you want to get the data of the table nested in the collection in the picture?

    There are two ways: Ungroup Or ForAll

    For example:

    My Data source:

     

     

    ClearCollect(
     CollUserskills,
     {
     UserSkills: Table(
     {Skill: "Skill1"},
     {Skill: "Skill2"}
     )
     },
     {
     UserSkills: Table(
     {Skill: "Skill1"},
     {Skill: "Skill4"},
     {Skill: "Skill4"}
     )
     },
     {UserSkills: Table({Skill: "Skill2"})}
    )

     

     

    mydatasource.JPG

    Case1:Ungroup

     

     

    Ungroup(CollUserskills,"UserSkills")

     

     

    ungroup.JPG

    Case2:ForAll

    Add a button and set it's OnSelect property to:

     

     

    ForAll(
     CollUserskills,
     ForAll(
     UserSkills, /*Traverse all records in UserSkills*/
     Collect(
     newcollection, /*Create a new collection to store the data*/
     Skill /*Save all records in UserSkills to a new collection(newcollection)*/
     )
     )
    )

     

     

    ForAll.JPG

    In addition,If you want to remove duplicates.Using the distinct function is a good choice.

    Best Regards,

    Bof

  • Makerapps Profile Picture
    8 on at

    Hello 

     

     

     

    Do your have idea how to play around that data format issue?

     

    Thank for your help

     

    Annotation 2020-05-18 232607.jpg
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Makerapps : 

    Do you want to traverse the id in GalleryUsers.AllItems to get a single column table consisting of the values of Concat (Office365Users.UserProfileV2 (id) .skills.Value; Value))?

    Please try this code:

     

    ClearCollect(CollUserskills;ForAll(GalleryUsers.AllItems;Concat(Office365Users.UserProfileV2(id).skills.Value;Value)))

     

    Best Regards,

    Bof

  • Makerapps Profile Picture
    8 on at

    Hi @v-bofeng-msft ,

     

    Thank a lot for your tips, it worked very well. My app has now :

    - an office 365 user gallery = 'Office365users'.SearchUser()

    - For each user, a label displaying the user's skills(Label2) = Concat('Office365users'.UserProfileV2(UserPrincipalName).skills.Value,Value,", ")

    - a combobox filled with all users'skills, thank to those formulas = Filter(Distinct(Ungroup(CollUserSkills,"Value"),Value),Result<>Blank())

     

    I've also tried to filter the user gallery using my combobox but I still have error message, can you please help me figure out what is wrong with my argument below? = Filter('Office365users'.SearchUser(), Label2.Text in ComboBox1.SelectedItems.Result)

     

    Thanks a lot

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard