cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sdedic
Advocate II
Advocate II

Convert 'Choice' column to text values within AddColumns function

Hi all,

 

I can't find the way to convert data from choice column into a text inside AddColumns function when the datasource is Dataverse. I am able to do this when using SharePoint, but the same formula doesn't seem to work with Dataverse.

 

Since I want to GroupBy my Gallery Items using a choice column, I have to convert that same column into text values using AddColumns function and then use it to group with GroupBy.

 

The choice column is named 'Stage'. However, I can't take the values from that column using expression 'Stage.Value'.

Here is the formula I am trying to utilize:

Screenshot 1

sdedic_0-1665524753799.png 

 

Screenshot 2

sdedic_1-1665525124761.png

 

 

As you can see, it finds the 'Stage' column inside 'Opportunities' data source (screenshot 1), but can't evaluate the data for the 'Stage' column (screenshot 2). When I try to retrieve its data with .Value option, I am getting an error (screenshot 3):

 

Screenshot 3:

sdedic_2-1665525303290.png

 

Here are the errors for the above formula:

sdedic_3-1665525486873.png

 

FYI: the third error "Name isn't valid. 'Value' isn't recognized." refers to 'Stage.Value' expression.

 

Any help is more than appreciated.

Ty.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Thank you for the suggestion @v-xiaochen-msft. Eventually, what worked is the formula from screenshot 1. So, when the datasource is Dataverse, it is enough just to name the choice column within AddColumns function.

 

For instance:

AddColumns(Source, "MyNewColumn", MyChoiceColumn)

 

View solution in original post

2 REPLIES 2
v-xiaochen-msft
Community Support
Community Support

Hi @sdedic ,

 

Please try to add a text() function in your formula.

AddColumns(...,"MyStage",Text(Stage))

 

Best Regards,

Wearsky

Thank you for the suggestion @v-xiaochen-msft. Eventually, what worked is the formula from screenshot 1. So, when the datasource is Dataverse, it is enough just to name the choice column within AddColumns function.

 

For instance:

AddColumns(Source, "MyNewColumn", MyChoiceColumn)

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,146)