# Change GPS Marker Color Based on Attribute

**URL:** https://forums.losant.com/t/change-gps-marker-color-based-on-attribute/3191
**Category:** Help
**Tags:** dashboard
**Created:** [August 11, 2020, 7:01pm UTC](https://forums.losant.com/t/change-gps-marker-color-based-on-attribute/3191 "2020-08-11T19:01:20Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Aidan\_Zebertavage](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/aidan_zebertavage/32/2719_2.png) [@Aidan\_Zebertavage](https://forums.losant.com/u/Aidan_Zebertavage)
#### Post date: [August 11, 2020, 8:22pm UTC](https://forums.losant.com/t/change-gps-marker-color-based-on-attribute/3191/3 "2020-08-11T20:22:19Z")

</div>

Hi @David_MacKenzie,

Yes, you can modify the color of the GPS based on the conditions of a given attribute. You’re going to want to use Conditional Block Helpers, which had a really nice write up as a Losant tip:

> [@Conditional Block Helpers](https://forums.losant.com/t/conditional-block-helpers/2022):
>
> [Conditional Block Helpers](https://docs.losant.com/workflows/accessing-payload-data/#conditional-block-helpers) provide an easy way to compare values and add a little logic within templates in the Losant Workflow Engine and Dashboards. These Helpers can be used in any field that is templatable, and can be useful to conditionally view data. Workflow Engine Conditional Block Helpers in a workflow can be used in many ways. In my use case, I have a device that sometimes reports data, and sometimes does not. I would like to visualize in a workflow in my Debug Panel if no data was sen…

In your GPS History block, first, you’ll want to configure additional attributes along with the GPS coordinates:

 ![Screen Shot 2020-08-11 at 4.12.43 PM](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/3/338305711ff53a664c62b72e1d5d482f988797fb.png)

Then, in your Point Display Configuration, under Pin Style, select ‘Advanced’ and using the icon template area input your code using Handlebars and the Conditional Block helpers to set the logic for determining pin color. You’ll want to use the {{#gt}} helper to set the conditional logic. I built up a test application based around the specifics you stated above, and was able to get the following code to modify the color of my GPS pin correctly, where 1000 is used as the threshold for the conditional:

```
{{#if isLastPoint}}
{{#gt data.motorHoursUsed 1000}}
{{colorMarker '#8db319'}}
{{else}}
{{colorMarker '#ff261b'}}
{{/gt}}
{{/if}}

```

Let me know if you have any other questions.

Thanks,  
@Aidan_Zebertavage

---

_[View the full topic](https://forums.losant.com/t/change-gps-marker-color-based-on-attribute/3191)._
