cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Zgolbarg
Helper III
Helper III

patch and filter

Hi,

 

I have a cascade dropdown:  Client name and Bill person. 

I have  2 list in Sp clients and contacts.

when a client is chosen based on the condition in the first dropdown, the Bill persons show up in the second dropdown.

I have this formula  in the Item property of my second dropdown list

 

ForAll(
Filter(Contacts, (Trim(drpClients.SelectedText.Value) in Company.Value) And (Bill_To.Value = "Yes")),
{value: 'Full Name',
Id:ID
}
)

here I have a list of some people and I need to choose one of them.

 

for patch in the submit button, I have this : Bill_To_Person: drpBillToName.Selected

 

but give me error.

 

Can you help me with that?

 

Thanks

2 ACCEPTED SOLUTIONS

Accepted Solutions
RandyHayes
Super User
Super User

@Zgolbarg 

So then this means that your Bill_To_Preson column is defined in SharePoint to Allow multiple Value.  Please check that in the definition in list settings.  If you do not need multiple values, then turn that off in the settings.  If you do, then we need to revise the formula and discuss a few other things.

_____________________________________________________________________________________
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

@RandyHayes 

 

Yes, it was multiple values. 

 

You are awesome. Thanks a lot

 

View solution in original post

8 REPLIES 8
RandyHayes
Super User
Super User

@Zgolbarg 

First, avoid using the SelectedText property of your dropdown control.  It is a deprecated property and should be avoided.

 

Next, what kind of column is Bill_To_Person in your list?

 

_____________________________________________________________________________________
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

It is a lookup column in Contact list. 

RandyHayes
Super User
Super User

@Zgolbarg 

So let's first alter that formula on the Item property of the Bill to dropdown.  It should be:

ForAll(
    Filter(Contacts, 
          drpClients.Selected.Value) in Company.Value &&
          Bill_To.Value = "Yes"
    ),
    {Value: 'Full Name',
     Id:ID
    }
)

This does two things:

1) It gets rid of the deprecated SelectedText property

2) It corrects that you had the Value with a lower case V.  Value needs to be uppercase V.

 

See where that gets you.  If the error persists, then let me know what the error is that you are getting.

_____________________________________________________________________________________
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Zgolbarg_0-1634234216070.png

I've got this error on your formula

on the drpclients give this error: invalid number of arguments: received 1, expected 2

 

and same error in submit button:  The type of this argument'Bill_To_Person' does not match the expected type Ttable' found type 'Record'

RandyHayes
Super User
Super User

@Zgolbarg 

There is an extra paren. Sorry about that.  Please scrub through the formulas I provide as I type them by hand without the aid of a design editor.

 

Formula should be:

ForAll(
    Filter(Contacts, 
          drpClients.Selected.Value in Company.Value &&
          Bill_To.Value = "Yes"
    ),
    {Value: 'Full Name',
     Id:ID
    }
)
_____________________________________________________________________________________
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Yes, I corrected formula before your message and it's fine now, but I have still the error on submit button:

 

The type of this argument 'Bill_To_Person' does not match the expected type 'Table'.  Found type 'Record'

 

Bill_To_Person: drpBillToName.Selected

RandyHayes
Super User
Super User

@Zgolbarg 

So then this means that your Bill_To_Preson column is defined in SharePoint to Allow multiple Value.  Please check that in the definition in list settings.  If you do not need multiple values, then turn that off in the settings.  If you do, then we need to revise the formula and discuss a few other things.

_____________________________________________________________________________________
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

 

Yes, it was multiple values. 

 

You are awesome. Thanks a lot

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (5,335)