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 / Getting Values from Re...
Power Apps
Answered

Getting Values from Record via Filed Name Collection

(0) ShareShare
ReportReport
Posted on by 4

How to get values into a collection from a record via field name collection?

 

i have a record, field name like checkname2, checkname3, checkname4 ... checkname20 etc.

 

previous i use Sequence and Concatenate to set up a collection(name collocetion A) of filed name (checkname2 .. to checkname20).

 

i have no idea to how to get the value via the collection A from the record.

Categories:
  • SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at

    Hi @QQY 

     

    To achieve that you can use the LookUp function. 

     

    For example if this is my collection:

    //Create a collection
    ClearCollect(myCars23,
    {SerialNo:"6453", Year: 2016, Make: "Toyota", Model: "Corolla"},
    {SerialNo:"8946",Year: 2014, Make: "Honda", Model: "Civic" },
    {SerialNo:"3571",Year: 2019, Make: "Toyota", Model: "Camry" },
    {SerialNo:"1165",Year: 2018, Make: "Honda",Model: "Civic"},
    {SerialNo:"8973",Year: 2018, Make: "Hyundai", Model: "Elantra"},
    {SerialNo:"4529",Year: 2020, Make: "Honda", Model: "Accord"}
    );
    
    //Get cell from 1st matching row
    Set(
     mySolution23a,
     LookUp(myCars23,SerialNo="8973", Model)
    );

    Source: Blog post

     

    If you want to loop through this is a example:

    ForAll(collectionA, 
     Collect(collectValues, 
     {Value: LookUp(record, Name = ThisRecord.Value)}
     )
    );

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube| [My blog]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • QQY Profile Picture
    4 on at

    hi SpongYe

     

    Need to get the Value Via A collection in Record mySolution23a like below, pls help!

     

     

    //Create a collection
    ClearCollect(myCars23,
    {SerialNo:"6453", Year1: 2016, Year2: 2017, Year3: 2018, Year... Year30: 2035},
    {SerialNo:"8946", Year1: 2019, Year2: 2020, Year3: 2021, Year... Year30: 2035},
    {SerialNo:"3571", Year1: 2022, Year2: 2023, Year3: 2024, Year... Year30: 2035},
    {SerialNo:"1165", Year1: 2025, Year2: 2026, Year3: 2027, Year... Year30: 2035},
    {SerialNo:"8973", Year1: 2028, Year2: 2029, Year3: 2030, Year... Year30: 2035},
    {SerialNo:"4529", Year1: 2031, Year2: 2032, Year3: 2033, Year... Year30: 2035}
    );
    
    //Get cell from 1st matching row
    Set(
     mySolution23a,
     LookUp(myCars23,SerialNo="6453")
    );
    
    // A collection: Field Name Collection
    {"Year1","Year2","Year3", "Year4"... "Year30"}
    
    target to have a collection 
    {Year1: 2016, Year2: 2017, Year3: 2018,Year... Year30: 2035}

     

     

  • SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at

    Hi @QQY 

     

    In your case you can use the ClearCollect function:

     

    ClearCollect(
     myCars23,
    {SerialNo:"6453", Year1: 2016, Year2: 2017, Year3: 2018},
    {SerialNo:"8946", Year1: 2019, Year2: 2020, Year3: 2021},
    {SerialNo:"3571", Year1: 2022, Year2: 2023, Year3: 2024},
    {SerialNo:"1165", Year1: 2025, Year2: 2026, Year3: 2027},
    {SerialNo:"8973", Year1: 2028, Year2: 2029, Year3: 2030},
    {SerialNo:"4529", Year1: 2031, Year2: 2032, Year3: 2033}
    );
    
    ClearCollect(
     mySolution23aCollection, 
     LookUp(myCars23,SerialNo="6453")
    );

     

    SpongYe_0-1717940440138.png

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube| [My blog]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

     

  • QQY Profile Picture
    4 on at

    Accrutly, The field scope changed by an indicater, means the fields value i want to get is also dynamicly, mean this time i would like to get the value of Year1 to Year10, next time would like get the value of Year5 to Year15.

    Simply use Lookup can't match my requirement. 

  • Verified answer
    QQY Profile Picture
    4 on at

    hi

     

    some progress shared here: 

     

    i use a multiple line text to store all the fileds data that i needed with index.

     

    Then i can use an indicate to trace the data i need.

     

    Tips: Index with filed data could be transfered to Json then stored in SP list multiple line text field.

     

    and use ParseJson to convert back to table for further usage in APPs.

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 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard