cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rnorris
Helper I
Helper I

invalid argument type when drilling down to lookup list

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!

1 ACCEPTED SOLUTION

Accepted Solutions

@rnorris 

Okay...that technically should have worked, but let's jump to the Update property now.

Set the formula to the following:

{
   Value: BP_Clients.Selected.Title,
   Id: BP_Clients.Selected.ID,
   '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
}
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

21 REPLIES 21
RandyHayes
Super User III
Super User III

@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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

@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.

 

 

 

@rnorris 

Thank you for the clarification.  

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

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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.

 

@rnorris 

Sorry typo in the formula I provided.

Please adjust:

Filter(
    theListThatBPClientsLooksUp,
    Legal_Entity = If(StartsWith(OwningOrg.Selected.Value, "EFS"), "EFS", "ESI")
)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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. 

@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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

rnorris_0-1602516272759.png

 

@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).

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,956)