cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
User237
Helper III
Helper III

How to show Enum values in label field.

Hi all,

I have created a powerApp with SQL server as my connection.

In my table one field called Type is present which is Enumeration datatype.

In the sql it stores as 0 for customer and 1 for vendor.

if i add that field in powerapp then it is showing as 0 and 1.

Now, i need to show customer and vendor instead of 0 and 1 respectively.

Please help me solve this ?

Thanks,

with regards,

user237.

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @User237 ,

Please check your column data type in your sql table.

I'm afraid there's no data type called Enumeration in sql server.

1)If your data type is varchar(10), your data is 0 or 1, then you could set like this in powerapps:

gallery's Items:

sqltabelname

label's Text in gallery:

If(ThisItem.fieldname="1","vendor",
ThisItem.fieldname="0","customer"
)

 

2)If your data type is int, your data is 0 or 1, then you could set like this in powerapps:

gallery's Items:

 

sqltabelname

 

label's Text in gallery:

 

If(ThisItem.fieldname=1,"vendor",
ThisItem.fieldname=0,"customer"
)

 

Then the label will display customer and vendor instead of 0 or 1.

 

 

Best regards,

 

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yutliu-msft
Community Support
Community Support

Hi @User237 ,

Please check your column data type in your sql table.

I'm afraid there's no data type called Enumeration in sql server.

1)If your data type is varchar(10), your data is 0 or 1, then you could set like this in powerapps:

gallery's Items:

sqltabelname

label's Text in gallery:

If(ThisItem.fieldname="1","vendor",
ThisItem.fieldname="0","customer"
)

 

2)If your data type is int, your data is 0 or 1, then you could set like this in powerapps:

gallery's Items:

 

sqltabelname

 

label's Text in gallery:

 

If(ThisItem.fieldname=1,"vendor",
ThisItem.fieldname=0,"customer"
)

 

Then the label will display customer and vendor instead of 0 or 1.

 

 

Best regards,

 

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (57,035)