cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PeteSa
Microsoft
Microsoft

Lookup function to Dataverse Choices datatype to Text input results in error

I am trying to do a Lookup of Dataverse Choices datatype, but it isn't working. I am getting an "Expected Text value" error.

 

here is my function:

LookUp(TableInfo,ID = "1007").Impact

 

Impact is a Choices datatype field

 

Please Help!

 

1 ACCEPTED SOLUTION

Accepted Solutions

Got it, cheers for clarifying. That's a normal error, you'll need to get the text values of the BusinessImpact choices since they're are multiple choices. What you're getting now is the collection. You can use the Concat function to get all the available values into one text. Here's what you expression should look like and an example:

Concat(LookUp(TableInfo,ID = "1007").BusinessImpact, Text(Value), ",")

EricRegnier_0-1642275360461.png

 

View solution in original post

8 REPLIES 8
dpoggemann
Super User
Super User

Hi @PeteSa ,

 

Sorry, what are you actually trying to do here, I am confused.  Do you have a table with a Choices column for Impact and you are trying to filter that table to show only ones with a specific value?  Are you trying to get all values that are possible for the Choices of Impact?

 

If you are displaying in a Form you can just do Choices(Impact) in a ComboBox and it will show you the options to select from.

 

Sorry, might be stupid question but just not sure what you are trying to do...

 

Hope this helps. Please accept if answers your question or Like if helps in any way.
Thanks,
Drew
PeteSa
Microsoft
Microsoft

Hi Drew,

 

I am trying to get the Impact field (Choices datatype) from the TableInfo source for a given ID through a Lookup function. I then want to display the value in a text field within a form. The Impact field is only a single select field; so there will only be one value.

 

Thanks,

Peter

 

Hello @PeteSa,

 

Can you please try the same

 

Consider

 

Filed Name : StateField

Field Option : Active     --> Value = 1007

                       InActive  --> Value = 1008

 

LookUp(TableInfo,ID = Choices(StateField).Active).Impact

 

 

Please mark as Answer if it is helpful and provide Kudos


Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Blog : https://microsoftcrmtechie.blogspot.com

Thanks for your response, but in my example the ID is the row , not the value of a choice.

 

So , somehow I need the Choices function around Impact or convert Impact to a Text type

EricRegnier
Super User
Super User

Hi @PeteSa,

Are you trying to have the Choices (aka optionsets) items as a data source for a control like in a gallery? If so, like @dpoggemann said, you can use the Choices function. Steps:

1) Add the table that references that choice that you want as data in your canvas app

2) Use the Choice function with the column of from that table in step #1

Here's an exmaple:

EricRegnier_0-1642197646750.png

Hope this helps!

No, that isn't what I am trying to do either.

 

I have a label with this function:

Text = LookUp(TableInfo,ID = "1007").ModelName

 

Everything is fine

 

Now, I switch the .ModelName field to a Choices field called .BusinessImpact. There is then an error "Expected Text Value", as BusinessImpact is a Choices datatype

 

PeteSa_0-1642209463636.png

 

 

 

 

 

 

 

 

 

 

 

 

 

Got it, cheers for clarifying. That's a normal error, you'll need to get the text values of the BusinessImpact choices since they're are multiple choices. What you're getting now is the collection. You can use the Concat function to get all the available values into one text. Here's what you expression should look like and an example:

Concat(LookUp(TableInfo,ID = "1007").BusinessImpact, Text(Value), ",")

EricRegnier_0-1642275360461.png

 

Thank you @EricRegnier !!! That solves my problem

Helpful resources

Announcements
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.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (1,507)