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 Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,163)