Image Description: The image shows a PowerApps error message indicating that the variable name 'nfGreenHexaOnly' isn't recognized. The error appears in code that's trying to set background colors for status badges based on conditional logic (Active/Inactive status values).
The issue is that I used incorrect color variable names (nfGreenHexaOnly, nfPrimaryHexaOnly, nfSecondaryDarkHexaOnly) that don't exist in your PowerApps app. I need to fix the gallery code to use either the correct variable names or direct hex color codes.
Here's the corrected gallery YAML with proper color codes:
- GalleryCanvas1:
Control: Gallery@1.0.0
Variant: galleryVertical
Properties:
DelayItemLoading: =true
Height: =Parent.Height - 200
Items: =ExternalEntities
Layout: =Layout.Vertical
LoadingSpinner: =LoadingSpinner.Data
TemplatePadding: =0
TemplateSize: =120
Width: =Parent.Width
X: =0
Y: =180
Children:
- Container1_1:
Control: GroupContainer@1.3.0
Variant: ManualLayout
Properties:
DropShadow: =DropShadow.Light
Fill: =RGBA(255, 255, 255, 1)
Height: =110
RadiusBottomLeft: =8
RadiusBottomRight: =8
RadiusTopLeft: =8
RadiusTopRight: =8
Width: =Parent.TemplateWidth - 20
X: =10
Y: =5
Children:
- TextCanvas1_1:
Control: Text@0.0.51
Properties:
Font: =Font.'Segoe UI'
Height: =30
HtmlText: ="<p style='margin:0;padding:0;color:" & nfPrimaryColor & "; font-size:20px; font-weight: bold;'>" & ThisItem.Title & "<span style='background:" & If(ThisItem.Status = "Active", "#16a34a", If(ThisItem.Status = "Inactive", "#dc2626", "#6b7280")) & ";color:white;padding:5px 15px; margin-left: 15px; display: inline-block; font-size: 14px;border-radius:5px;border:1px solid " & If(ThisItem.Status = "Active", "#16a34a", If(ThisItem.Status = "Inactive", "#dc2626", "#6b7280")) & ";'>" & ThisItem.Status & "</span><span style='background:" & If(ThisItem.EntityType = "Corporation", "#3b82f6", If(ThisItem.EntityType = "Partnership", "#8b5cf6", "#f59e0b")) & ";color:white;padding:5px 15px; margin-left: 15px; display: inline-block; font-size: 14px;border-radius:5px;border:1px solid " & If(ThisItem.EntityType = "Corporation", "#3b82f6", If(ThisItem.EntityType = "Partnership", "#8b5cf6", "#f59e0b")) & ";'>" & ThisItem.EntityType & "</span></p>"
Size: =20
VerticalAlign: =VerticalAlign.Middle
Weight: ='TextCanvas.Weight'.Bold
Width: =Parent.Width - 80
X: =15
Y: =10
- TextCanvas2_1:
Control: Text@0.0.51
Properties:
Color: =RGBA(100, 100, 100, 1)
Font: =Font.'Segoe UI'
Height: =25
Size: =13
Text: ="Contact: " & ThisItem.ContactName & " | " & ThisItem.ContactEmail
VerticalAlign: =VerticalAlign.Middle
Width: =Parent.Width - 300
X: =15
Y: =45
- TextCanvas3_1:
Control: Text@0.0.51
Properties:
Color: =RGBA(100, 100, 100, 1)
Font: =Font.'Segoe UI'
Height: =25
Size: =13
Text: ="Phone: " & ThisItem.ContactPhone & " | Country: " & ThisItem.Country
VerticalAlign: =VerticalAlign.Middle
Width: =Parent.Width - 300
X: =15
Y: =70
- TextCanvas4_1:
Control: Text@0.0.51
Properties:
Color: =RGBA(100, 100, 100, 1)
Font: =Font.'Segoe UI'
Height: =25
Size: =12
Text: =If(!IsBlank(ThisItem.Website), "Website: " & ThisItem.Website, "")
VerticalAlign: =VerticalAlign.Middle
Width: =250
X: =Parent.Width - 280
Y: =45
- TextCanvas5_1:
Control: Text@0.0.51
Properties:
Color: =RGBA(100, 100, 100, 1)
Font: =Font.'Segoe UI'
Height: =25
Size: =12
Text: ="Users: " & ThisItem.UserCount & " | Created: " & Text(ThisItem.Created, "mm/dd/yyyy")
VerticalAlign: =VerticalAlign.Middle
Width: =250
X: =Parent.Width - 280
Y: =70
- ButtonCanvas1_1:
Control: Button@0.0.45
Properties:
Appearance: ='ButtonCanvas.Appearance'.Transparent
Height: =30
Icon: ="MoreVertical"
IconStyle: ='ButtonCanvas.IconStyle'.Filled
Layout: ='ButtonCanvas.Layout'.IconOnly
OnSelect: =
Text: =
Width: =40
X: =Parent.Width - 50
Y: =10I've fixed the color references by using direct hex color codes instead of the non-existent variable names. The status badges now use #16a34a (green) for Active, #dc2626 (red) for Inactive, and #6b7280 (gray) for other statuses. The entity type badges use #3b82f6 (blue) for Corporation, #8b5cf6 (purple) for Partnership, and #f59e0b (orange) for Government.
"<p style='margin:0;padding:0;color:" & nfPrimaryHexaOnly & "; font-size:20px; font-weight: bold;'>" & ThisItem.Title & "<span style='background:" & If(ThisItem.Status = "Active", nfGreenHexaOnly, If(ThisItem.Status = "Inactive", "#FF0000", nfSecondryDarkHexaOnly)) & ";color:white;padding:5px 15px; margin-left: 15px; display: inline-block; font-size: 14px;border-radius:5px;'>" & ThisItem.Status & "</span> <span style=';padding:5px 15px; margin-left: 15px; display: inline-block; font-size: 14px;border-radius:5px;border:1px solid #cccccc;'>" & ThisItem.EntityType & "</span></p>"
just fix this
Here's the corrected line with proper hex color codes:
"<p style='margin:0;padding:0;color:#8b1538; font-size:20px; font-weight: bold;'>" & ThisItem.Title & "<span style='background:" & If(ThisItem.Status = "Active", "#16a34a", If(ThisItem.Status = "Inactive", "#FF0000", "#6b7280")) & ";color:white;padding:5px 15px; margin-left: 15px; display: inline-block; font-size: 14px;border-radius:5px;'>" & ThisItem.Status & "</span> <span style=';padding:5px 15px; margin-left: 15px; display: inline-block; font-size: 14px;border-radius:5px;border:1px solid #cccccc;'>" & ThisItem.EntityType & "</span></p>"I've replaced the undefined variables with direct hex codes: #8b1538 (Cross Catholic burgundy) for the title color, #16a34a (green) for Active status, and #6b7280 (gray) for other statuses.