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 collection ...
Power Apps
Unanswered

How to use collection to fetch record from table and store the result in another collection

(0) ShareShare
ReportReport
Posted on by 243

Hi,

 

I have 2 Tables 

I filtered data from one table based on Today's date and stored in a collection

I want to filter another table based on a field from my collection and need to store the result in another collection

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,799 Most Valuable Professional on at

    Hi @SumanKoduri
    You do the same again - filter the second one

    Filter(
     YourDataSetName,
     YourFieldName = Gallery1Name.Selected.YourFieldName
    )

     

    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.

  • SumanKoduri Profile Picture
    243 on at

    Thank you.

    I'm not using Gallery to filter record, I'm creating collection directly from table based on Today's date.

     

  • WarrenBelz Profile Picture
    154,799 Most Valuable Professional on at

    Thanks @SumanKoduri ,

    I was just giving you the filter code.

    I you give me the relevant field and data source names, as well as the collect code for you first collection, I will try to guide you.

    To collect the second one, from what I understand in your post

    ClearCollect(
     colSecond
     Filter(
     YourDataSetName,
     YourFieldName = Gallery1Name.Selected.YourFieldName
     )
    )

    I can do a more precise job when I know exactly what you want to do.

     

    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.

     

  • SumanKoduri Profile Picture
    243 on at
    ClearCollect(Collection1,Filter('[5006RETURNS_LOG]',IsToday(C5006_RETURN_LOGGED_DT)));
     
    From this collection I need to filter another 5007logdetail table, common field is id
    so based on the Id from collection1 I need to filter in 5007 table
  • WarrenBelz Profile Picture
    154,799 Most Valuable Professional on at

    Ok @SumanKoduri ,

    You are getting today's records with a collection as below

     

    ClearCollect(
     Collection1,
     Filter(
     '[5006RETURNS_LOG]',
     IsToday(C5006_RETURN_LOGGED_DT)
     )
    );

     

    and displaying this in a gallery I will call Gallery2 which then has to be selected to show the relevant record in a form and in this data set 5007logdetail  is an ID that you want to select to display the record on a form? If all of these assumptions are correct, the Item property of the Form would be something like

     

    Lookup(
     5007logdetail,
     ID = Gallery2.Selected.ID
    )

     

    Note I cannot see your data and need to rely on you for the correct field names and references.

     

    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.

     

  • SumanKoduri Profile Picture
    243 on at

    this is my first collection record

     

    select * from returns_log where trunc(C5006_RETURN_LOGGED_DT) = to_date('04-03-2020', 'dd-mm-yyyy');

     

    RETURNS_LOG_IDSENDER_NAMEC5006_RETURN_LOGGED_DT
    123Jason04-MAR-20
    124Kumar04-MAR-20
    125Jack04-MAR-20

     

    From the above data i need to fetch data from another table using log id

    select * from returns_log_detail where returns_log_detail_id in (122,123,124,125);

     

    RETURNS_LOG_DETAIL_IDTAG_IDPART_NUMBER_ID
    12322226908.005
    12422227908.006
  • WarrenBelz Profile Picture
    154,799 Most Valuable Professional on at

    Hi @SumanKoduri ,

    That is SQL - not sure where that fits into Power 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard