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

Display filtered value in label

Hi,

     I am filtering data based on below condition. My collection has multiple columns . I want to get the single column value from filtered values.

Label59 Text value : Filter(col1,ProgramIncrement_ID in ComboBox5.SelectedItems.program_increment_id && Program_ID in ComboBox4.SelectedItems.Program_ID).Id

I want to extract Id value from the results obtained from above filter.

 

Note : The above gives me error saying expecting text values.

Can someone help me how the syntax looks for that please ?

 

Regards,

Manoj

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Display filtered value in label

@kullurumanoj 

The issue in your formula is that Filter returns a table of records that match the condition you specify.  The table can have no to many records, but it will always be a table.  Therefore specifying the .Id on the Filter is not valid because you are not specifying what record you want to return the Id from.

You will need to either specify which record in the table that you want the Id to come from, or use a Lookup to return just one record.

 

To return one record that matches your condition (always the first record encountered), use this formula:

Lookup(col1,
ProgramIncrement_ID in ComboBox5.SelectedItems.program_increment_id &&
Program_ID in ComboBox4.SelectedItems.Program_ID).Id

If you want to return a sepcific record from the results of a Filter, then use the following formula:

Last(
FirstN(
Filter(col1,
ProgramIncrement_ID in ComboBox5.SelectedItems.program_increment_id &&
Program_ID in ComboBox4.SelectedItems.Program_ID),
x
)).Id

Replace x above with the record number in the table you want to return.  

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

3 REPLIES 3
Highlighted
Super User III
Super User III

Re: Display filtered value in label

@kullurumanoj 

The issue in your formula is that Filter returns a table of records that match the condition you specify.  The table can have no to many records, but it will always be a table.  Therefore specifying the .Id on the Filter is not valid because you are not specifying what record you want to return the Id from.

You will need to either specify which record in the table that you want the Id to come from, or use a Lookup to return just one record.

 

To return one record that matches your condition (always the first record encountered), use this formula:

Lookup(col1,
ProgramIncrement_ID in ComboBox5.SelectedItems.program_increment_id &&
Program_ID in ComboBox4.SelectedItems.Program_ID).Id

If you want to return a sepcific record from the results of a Filter, then use the following formula:

Last(
FirstN(
Filter(col1,
ProgramIncrement_ID in ComboBox5.SelectedItems.program_increment_id &&
Program_ID in ComboBox4.SelectedItems.Program_ID),
x
)).Id

Replace x above with the record number in the table you want to return.  

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Highlighted
Community Support
Community Support

Re: Display filtered value in label

Hi @kullurumanoj 

 

Do you test with @RandyHayes 's suggestion?

If it works ok, please accept it as solution.

 

Best Regards.

Yumia

Highlighted
Helper III
Helper III

Re: Display filtered value in label

Hi @v-yuxima-msft @RandyHayes ... It worked for me.

 

Thanks,

Manoj

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,850)