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

Convert "Control" data type to Text

Hello all,

 

I've been working on sort buttons, which aren't a problem, but I've hit a snag. I created a sort button for an added column that is a choice column without issue (like in this thread), but when I tried it for another similar policy, I kept getting this error message for the column I was trying to add. Apparently, this column is a "control" data type which isn't even listed here. I looked at the SharePoint list, and that column is tied to a group in my organization -- I can only assume that this is what "Control" is in this case. I can't find any way to convert these values to text (neither with .Value or with Text()). Does anyone have any solution for dealing with this? The best I can come up with is some sort of duplication of the value in that field in the SharePoint list but as a text value, but I'd prefer if there were a function in PowerApps I could use.

 

PowerAppControl.JPG

 

Best,

Z

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Convert "Control" data type to Text

@zeuslyone
I would try replacing "PM Name", AssignedPM.Value with the following code

"PM Name", AssignedPM.DisplayName

A person record has several properties and I’m not sure what Value represents but DisplayName should return a Text data type instead. As a general rule when working with a complex column the property will be different than .Value

—-
Please Accept as Solution if this post answered your question so others can find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

View solution in original post

5 REPLIES 5
Super User
Super User

Re: Convert "Control" data type to Text

@zeuslyone
Please share your code and tell us what control/property you’ve placed it within.
zeuslyone
Level: Powered On

Re: Convert "Control" data type to Text

This happens when I try to add a new column which changes the column into text that could be sorted. This function below works (just changed the source name to generic for sharing) until I add the underlined red text. I'm not sure what you mean about what "control/property you've placed it within" -- I didn't create this app, rather editing it for a colleague, but as I said, on the SharePoint end, the column is set to: "Type - Person or Group", and on the PowerApps end is set to: "FieldType: Complex"

SortByColumns(AddColumns(Source Name, "Source", SourceQuarter.Value, "PM Name", AssignedPM.Value), Sortfield, If(SortDirection, Descending, Ascending))

 

Let me know what else I can clarify. Thanks!

Best,

Zack

Super User
Super User

Re: Convert "Control" data type to Text

@zeuslyone
I would try replacing "PM Name", AssignedPM.Value with the following code

"PM Name", AssignedPM.DisplayName

A person record has several properties and I’m not sure what Value represents but DisplayName should return a Text data type instead. As a general rule when working with a complex column the property will be different than .Value

—-
Please Accept as Solution if this post answered your question so others can find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

View solution in original post

zeuslyone
Level: Powered On

Re: Convert "Control" data type to Text

Thank you, @mdevaney ! I appreciate the help and the educational explanation. I'm still figuring my way around the syntax here, so I appreciate the helpful patience.

Super User
Super User

Re: Convert "Control" data type to Text

@zeuslyone 

No problem at all. 

 

I cannot seem to find any documentation for people objects but you can always type AssignedPM. (make sure to type the period too) and then see what fields are available in the autocomplete.

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 (4,443)