web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Invalid Argument Type ...
Power Apps
Unanswered

Invalid Argument Type in nested ForAll

(0) ShareShare
ReportReport
Posted on by 11

Hi, 

 

Trying to create a nested ForAll with filters,

 

First ForAll filters a collection, containing some Items (with itemkey = No) depending on an item category (Standard Sales Code),

 

Second ForAll Filters the Item Table in order to retrieve Item characteristics for each item populated in the first ForAll. Was thinking to use the item Key 'No' to be abble to filter and disambiguating using the First Collection Name as prefix. But when doing this i always get a message "Invalid argument type". (have also tried using lookup but also getting same message).

 

 ForAll.PNG

Any idea what could be the trick to solve this?

 

Regards

 

 

Categories:
I have the same question (0)
  • Etienne Leneveu Profile Picture
    11 on at

    I finally achieved to get the exepected result, 

     

    I created an additionnal collection (named tempStandardSalesLines), where i'm doing filetring on the base collection.

     

     

    ForAll.PNG

     

    This works fine, however think a bit annoying to duplicate collection just for filtering. Maybe someone has a better idea?

  • eka24 Profile Picture
    20,923 on at

    Try and wrap the error with Value:

    Value (No)=LocalstandardSales

    Or

    No=Value(LocalstandardSales)

     

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

     

  • Etienne Leneveu Profile Picture
    11 on at

    Hi Eka 24, 

     

    Tried both options but none is succesful. 

  • v-bofeng-msft Profile Picture
    on at

    Hi @EtienneFr :

    Firstly, let me explain why the code not work.

    The point is LocalStandardSalesLines[@No] is a one-column table It has nothing to do with your circulation body (Filter(Loca……)).

    Secondly, Congratulations on solving this problem yourself. In addition, I have a new idea.

    The difference between the two solutions is how to disambiguate:

    My code:

    ForAll(

    RenameColumns(

        Filter(

            LocalStandardSalesLines;

            Standard_Sales_Code=ThisItem.Code

        );

        "No";

        "Noo"

    );

    ForAll(

    Filter(

     localItems;

     No=Noo

    );Collect(……

    I think you should be able to understand what I mean.

    I think this link will help you a lot:

    AddColumns, DropColumns, RenameColumns, and ShowColumns functions in Power Apps

    Best Regards,

    Bof

  • Etienne Leneveu Profile Picture
    11 on at

    Thanks for the tip, I'll definitively have a look into it.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard