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 / Create collection with...
Power Apps
Answered

Create collection with a single field from a Sharepoint List person field

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a Sharepoint list (Konsepter) with a person field (beslutningstaker) and need to create a collection in my app (Collection_1) with one the department data from the person field.

 

Using ClearCollect(Collection_1;Konsepter.beslutningstaker) gives me a collection with all columns:

 

Skjermbilde10.PNGSkjermbilde11.PNG

What I am trying to do, is to make a collection with on the Department – furthermore – only the first four letters inn the department, so that the item from the second picture should show up in the collection like this:

 

Inno

Categories:
  • WarrenBelz Profile Picture
    156,774 Most Valuable Professional on at

    Hi @Anonymous ,

    Try

    ClearCollect(
     Collection_1;
     ShowColumns(
     Konsepter;
     "beslutningstaker"
     )
    )

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks @WarrenBelz ,

     

    That gives me the same result as in my initial example.

     

    I need a collection with only the first four letters of the Department part of the Person data.

     

    Lars

  • WarrenBelz Profile Picture
    156,774 Most Valuable Professional on at

    Hi @Anonymous ,

    A tricky one - I am still doing some testing here, but two of my colleagues, @Anonymous and @mdevaney are very good at formulas - I have mentioned them to flag them to see if they can help also while I am looking at it.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I'm crossing my fingers for either @Eelman or @mdevaney getting back to me.

     

    Lars

  • mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 

    Are you trying to UNGROUP the collection?

     

    //Ungroup a table stored in a collection
    ClearCollect(
     mySolution,
     Ungroup(
     ShowColumns(Konsepter,"beslutningstaker"),
     "beslutningstaker"
     )
    );
    

     

    ---
    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."

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Anonymous 

    I think I have a solution for you, and thanks @WarrenBelz  for adding me in 🙂

     

    I was able to create a collection similar to what you want, using something like:

    ForAll(
     Konsepter.beslutningstaker;
     Collect(
     Collection_1;
     Left(
     beslutningstaker.Department;
     4
     )
     )
    )

    Notes:

    1. I've attempted to add ";"'s where I have ',''s in my code so if you get some errors you will just need to adjust accordingly.

    2. Depending on how large your data set is, this may stop collecting records past the Max delegation limit number of 2000 records, not sure?

     

    Let me know how it goes! 

     

    Cheers

     

     

  • WarrenBelz Profile Picture
    156,774 Most Valuable Professional on at

    Hi @Anonymous ,

    Please accept whichever post of @Anonymous or @mdevaney helped you most in solving your issue.

    I had a time zone issue with spending the amount of time needed as well and it was good the others took two different but equally good approaches.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi, @WarrenBelz : Using Ungroup , like @mdevaney  suggested, gave me the same result as earlier, but using ForAll – like @Anonymous  suggested worked like a dream. Thank you so much for your help, all of you!

     

    Lars

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 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard