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 / invalid argument type ...
Power Apps
Answered

invalid argument type when drilling down to lookup list

(0) ShareShare
ReportReport
Posted on by 66

So I have a SPO list that uses other lists as lookups, and a PowerApps form/app to feed that list. LE is a variable I define thusly: Set(LE, Left(OwningOrg.Selected.Value, 3))

 

Compare the following 2 lines, the first has no error but sets the data source to a sub list, and the record does not get written to parent list, the second gives error 'invalid argument type' when I attempt to drill down to the lookup list column "legal_entity" yet the data source is correct ...

 

If(LE="EFS", Filter('BP Clients', Legal_Entity="EFS"), Filter('BP Clients', Legal_Entity="ESI"))

If(LE="EFS", Filter([@'B&P'].'BP Clients', Legal_Entity="EFS"), Filter([@'B&P'].'BP Clients', Legal_Entity="ESI"))

 

any help appreciated!

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @rnorris 

    Can you explain more about your scenario?  Is this all happening in an EditForm?  I ask this in reference to your statement that "record does not get written".

     

    As for the second formula, you should be referencing the actual list that is set for the lookup.  So, something more like this:

    Filter(
     theListThatBPClientsLooksUp,
     Legal_Entity = If(StartsWith(OwningOrg.Selected.Value), "EFS", "EFS", "ESI")
    )

    This will filter the looked up list based on the criteria you want. 

    You would not create a filter on the main list column as I believe you were demonstrating in your original formula.

     

    I hope this is helpful for you.

  • rnorris Profile Picture
    66 on at

    @RandyHayes,

    Yes this is an Edit Form. Here is a screen snip..

    rnorris_0-1602507842193.png

    I'm trying to cascade the owning organization to limit the choices in BP Clients. BP Clients list has Title and Legal_Entity. Legal_Entity will be ESI or EFS. If the Owning Org chosen is EFS I need the clients filtered on that key, else ESI.

     

     

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @rnorris 

    Thank you for the clarification.  

    Yes, then the formula I last provided is accurate based on your description.  Have you tried that?

  • rnorris Profile Picture
    66 on at

    yes tried this: 

     

    Filter(
    'BP Clients',
    Legal_Entity = If(StartsWith(OwningOrg.Selected.Value), "EFS", "EFS", "ESI")
    )

    and getting error invalid argument type (Text). Expecting a Boolean value instead.

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @rnorris 

    Sorry typo in the formula I provided.

    Please adjust:

    Filter(
     theListThatBPClientsLooksUp,
     Legal_Entity = If(StartsWith(OwningOrg.Selected.Value, "EFS"), "EFS", "ESI")
    )
  • rnorris Profile Picture
    66 on at

    Randy, that's making headway, but I'm back to full circle of results when using  If(LE="EFS", Filter('BP Clients', Legal_Entity="EFS"), Filter('BP Clients', Legal_Entity="ESI"))  logic, namely  when I look at the data source on the combo box it shows "BP Clients" not B&P, and on saving the form the BP Clients column is left blank, aka the save function didn't write that to the B&P list. 

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @rnorris 

    To be clear, the column in your list is a Lookup Column?

    If so, what list does it Lookup and what value does it use?  You can find all of this in the Column definition in your SharePoint list. If you can send a screenshot of that, it would be helpful as well.

  • rnorris Profile Picture
    66 on at

    Yes the "BP Clients" column in SPO is a "lookup" column. Screen snip of that column def from SPO follows:

    rnorris_0-1602516272759.png

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @rnorris 

    Okay, so going back the your message prior to my question - you are stating that you want names from a B&P list?  The column is defined to have values from BP Clients?

    (let's clarify that one first and then we will move on the the saving and displaying in your dropdown).

  • rnorris Profile Picture
    66 on at

    um yes I think... 

    So big picture I have a form that feeds a SPO list called B&P. One of it's columns is a lookup from another list named BP Clients. In the form when I choose Owning Organization, I want to filter the dropdown choices I see in BP Clients in light of the choice I made in the org. Your suggestion achieves this filtration perfectly.

     

    When the form is complete with all required choices made, then saved, I want those values to show up in the B&P list item. This is not happening... at save the BP Clients column is left blank.

     

     

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 250

#3
Mohsin Ali Profile Picture

Mohsin Ali 225

Last 30 days Overall leaderboard