cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
corinmurphy
Level: Powered On

Converting a single record to a value

I am creating a collection in which I need to capture the unique identifier (column1) for each record collected. In this case, column1 is based on the unqiue combinations of color and item number. I am currently building the collection using: 

Collect(MyCollection, 
{Quantity: Enter_qty.Text,
Column1: First(Distinct(Filter(Filter(Filter(DataTable, RM_item_number = ItemNumber.Text), RM_vendor_name = SelectVendor.Selected.Result), RM_color = Color_Label.Text), Column1))})

 I am running into issues with my Column1 field. Instead of collecting the referenced value, a table (of one value) is created. I am trying to patch this collection into my dataset, so I need this field to match with the Column1 value in my data set. Is there a way to convert this single record to a value, or collect a value rather than a table? Any guidance here would be very appreciated! Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
corinmurphy
Level: Powered On

Re: Converting a single record to a value

Solved my own problem here - if anyone else runs into the same issue, it can be avoided by adding .Result to the end of the record reference. The correct code is as follows 

Collect(POs, {Quantity: Enter_qty.Text, 

Column1: First(Distinct(Filter(Filter(Filter(DataTable, RM_item_number = ItemNumber.Text), RM_vendor_name = SelectVendor.Selected.Result), RM_color = Title5.Text), Column1)).Result})

View solution in original post

1 REPLY 1
Highlighted
corinmurphy
Level: Powered On

Re: Converting a single record to a value

Solved my own problem here - if anyone else runs into the same issue, it can be avoided by adding .Result to the end of the record reference. The correct code is as follows 

Collect(POs, {Quantity: Enter_qty.Text, 

Column1: First(Distinct(Filter(Filter(Filter(DataTable, RM_item_number = ItemNumber.Text), RM_vendor_name = SelectVendor.Selected.Result), RM_color = Title5.Text), Column1)).Result})

View solution in original post

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,622)