cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous_Hippo
Super User
Super User

How to get data in the form of a single value rather than a table inside collection column

Dears,

 

I am using a ForAll function but it returns the data as a table. How can i convert it into a single column

 

This is how the data is returned

Anonymous_Hippo_0-1653505675296.png

Anonymous_Hippo_1-1653505686002.png

All these tables only have one record.

 

I would like this collection to look like this

 

DrRDate | Drid | ID

5/3/2022 | 2 | 2

2/2/2022 | 1 | 1

 

This is the formula that i am using

 

ForAll(
    col_Sample,
    ForAll(
        Split(
            'Deficiency #',
            Char(10)
        ),
        Collect(
            Test212,
            {
                ID: ID,
                Drid: Result,
                DrRDate: Last(
                    FirstN(
                        Split(
                            'DR Received Date',
                            Char(10)
                        )
                    )
                )
            }
        )
    )
);

 

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
BCBuizer
Super User
Super User

HI @Anonymous_Hippo ,

 

Try calling the column in the record:

ForAll(
    col_Sample,
    ForAll(
        Split(
            'Deficiency #',
            Char(10)
        ),
        Collect(
            Test212,
            {
                ID: ID,
                Drid: Result,
                DrRDate: Last(
                    FirstN(
                        Split(
                            'DR Received Date',
                            Char(10)
                        )
                    )
                ).Result
            }
        )
    )
);

 

View solution in original post

3 REPLIES 3
BCBuizer
Super User
Super User

HI @Anonymous_Hippo ,

 

Try calling the column in the record:

ForAll(
    col_Sample,
    ForAll(
        Split(
            'Deficiency #',
            Char(10)
        ),
        Collect(
            Test212,
            {
                ID: ID,
                Drid: Result,
                DrRDate: Last(
                    FirstN(
                        Split(
                            'DR Received Date',
                            Char(10)
                        )
                    )
                ).Result
            }
        )
    )
);

 

Anonymous_Hippo
Super User
Super User

Sorry ,May i ask one more question @BCBuizer !

 

I am trying to recreate a collection by splitting it based on Char(10)

For example this is the original collection

Anonymous_Hippo_0-1653579491369.png

I want to create a new collection that would basically loop though and make each date into a single row

This is how i want it to look

 

ID | DRDueDate

1 | 1/2/2022

1 | 5/5/2022

1 | 2/4/2022

2 | 1/2/2022

2 | 5/5/2022

 

How can i do that. Using two forall loops doesn't seem to work correctly, can you please help 🙂 This is my corrected formula

ForAll(col_Sample,
    ForAll(
        Split('Deficiency #',
            Char(10)
        ),
        Collect(
            Test2121,
            {
                ID: ID,
                Drid: Result,
                DrRDate: Last(FirstN(
                        Split(
                            'DR Received Date',
                            Char(10)
                        ),CountRows(Test2121)+1)
                ).Result
            }
        )
    ))
;

 

@BCBuizer Please disregard my previous question. I was able to figure out why it was not working . Thank you !

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,733)