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 Apps
Unanswered

ForAll Function

(0) ShareShare
ReportReport
Posted on by 12

hudan_0-1717498092062.png

They're both have the same exact function, but the bottom one has errors, why is that?
The errors stated in the forall function are invalid arguments

 

Categories:
I have the same question (0)
  • mmbr1606 Profile Picture
    14,605 Super User 2026 Season 1 on at

    hey @hudan 

     

    please copy paste your code here so we do not need to retype.

     

    thanks in advance

  • hudan Profile Picture
    12 on at

        ClearCollect(SelectedItemsCollection2, PIC_input.SelectedItems);

            ForAll(

                SelectedItemsCollection2,

                Patch(

                PIC_Pekerjaans,

                    Defaults(PIC_Pekerjaans),

                    {  

                        ID_Pekerjaan:Last(Sort('Paket Pekerjaans',ID,SortOrder.Ascending)),

                        PIC_Name:ThisRecord

                    }

                )

            );

        ClearCollect(SelectedItemsCollection3, Lead_PIC_input.SelectedItems);

            ForAll(

                SelectedItemsCollection3,

                Patch(Name_Lead_PICS,      

                    Defaults(Name_Lead_PICS),

                    {

                        Lead_ID_Pekerjaan: Last(Sort('Paket Pekerjaans',ID,SortOrder.Ascending)),

                        Name_Lead_PIC:ThisRecord

                    }

                )

            );  

    here is the code

  • hudan Profile Picture
    12 on at

     ClearCollect(SelectedItemsCollection2, PIC_input.SelectedItems);

            ForAll(

                SelectedItemsCollection2,

                Patch(

                PIC_Pekerjaans,

                    Defaults(PIC_Pekerjaans),

                    {  

                        ID_Pekerjaan:Last(Sort('Paket Pekerjaans',ID,SortOrder.Ascending)),

                        PIC_Name:ThisRecord

                    }

                )

            );

       

    ClearCollect(SelectedItemsCollection3, Lead_PIC_input.SelectedItems);

            ForAll(

                SelectedItemsCollection3,

                Patch(Name_Lead_PICS,      

                    Defaults(Name_Lead_PICS),

                    {

                        Lead_ID_Pekerjaan: Last(Sort('Paket Pekerjaans',ID,SortOrder.Ascending)),

                        Name_Lead_PIC:ThisRecord

                    }

                )

            );  

    I'm sorry thanks for the help

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!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 84

#2
WarrenBelz Profile Picture

WarrenBelz 79 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 40 Super User 2026 Season 1

Last 30 days Overall leaderboard