cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lvdp
Frequent Visitor

Displaying choice fields in a datatable as part of a collection

I have a Sharepoint List with a choice field for Item status

I created a collection from the SP list called "MyCollection" and the choice field shows [order Order] when I display it in a Data Table

I need the collection so I can create a second collection and use AddColumns to format the dates correctly for Australia, but I don't know how to get the choice list options to display correctly.
I can't use a gallery as the real list I need this to work on has > 2000 items.

 

My Code on the Format button looks like this:

 

ClearCollect(MyCollection, 'Custom List');
ClearCollect(MyFormattedCollection,
AddColumns(MyCollection,
"CreatedAU", Text(Created, "[$-en-US]dd/mm/yyyy")
)
)

choiceformat.PNG

 

 

What do you need to do to fix the display of the Item Status column in the collection?

 

1 ACCEPTED SOLUTION

Accepted Solutions
aprildunnam
Power Participant
Power Participant

I've ran into this same problem.  I addressed it by created another column to hold the value of your choice field.  So for example:

 

ClearCollect(MyCollection, 'Custom List');
ClearCollect(MyFormattedCollection,
AddColumns(MyCollection,"ItemStatusFormatted",ItemStatus.Value,
"CreatedAU", Text(Created, "[$-en-US]dd/mm/yyyy")
)
)

The key is getting the column name and appending ".Value" to it to get the value of the choice column.

View solution in original post

2 REPLIES 2
aprildunnam
Power Participant
Power Participant

I've ran into this same problem.  I addressed it by created another column to hold the value of your choice field.  So for example:

 

ClearCollect(MyCollection, 'Custom List');
ClearCollect(MyFormattedCollection,
AddColumns(MyCollection,"ItemStatusFormatted",ItemStatus.Value,
"CreatedAU", Text(Created, "[$-en-US]dd/mm/yyyy")
)
)

The key is getting the column name and appending ".Value" to it to get the value of the choice column.

lvdp
Frequent Visitor

Thank-you so much - fixed my issue!  I was stuck on the syntax for adding choice list values.

 

The only tip I'd give others is that you should generate your collection with the new columns and THEN add the data table based on the collection so you can select the newly generated columns for display!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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