rwilson504 / PCFControls

Reusable PowerApps Control Framework (PCF) controls.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New functionality

slemale opened this issue · comments

commented

Hi Richard,

Sorry I am not reporting an issue but asking for a functionality and I didn't know how to contact you...

I am looking to display records with different pin colors depending on a specific field.
For example, my accounts are categorized (farmers, distributors, prescriptors) and I would like to display them on a map with a different color depending on the category field.

Do you know if this is something that you could easily add in your project ? (Bing or Azure Maps)

Also, I can't see the solution for teh PCF control Azure Maps. Could you create it ?

Thanks in advance for your feedback.
Sebastien.

Sebastien,

Thank you for noticing that the managed solution for the Azure Maps Grid was not there. I have updated the release pipeline and it should be there on the latest release.

As far as the color functionality implementing a way for you to choose each or your categories would actually be pretty tricky within the Map control properties. My first though would be to allow you to define some json within the properties to map the values to colors, unfortunately there is currently a bug in the PCF controls which does not allow more than 100 characters in an input property so that would be a major issue.

What i would suggest is this that you get that color information into the view data in one of two ways depending on your Category field type.

If Lookup

-If the Category is a a lookup on the Account entity then add a new text field called Color to your Category entity and use my color picker control on that field which would then allow you to define a color for each of the categories.
-Include the Categories-> Color field in your view. When you add columns to a view you can add fields from a related entity.
-Update the Pushpin Color Field in the Map Control to point to the data for the Category Color. You can do this by specifying the Category Entity name and the Color Field name together with a period separating them. Eg new_categoryentity.new_color

If Optionset - Idea 1
-Create a new Color field on your account entity and make it a calculated text field.
-Use the calculated field designer to do a big Else/If of which color relates to which category.
-Include the new calculated Color field on your view for the Map Control
-Update the Pushpin Color Field in the properties to point to the new color field you added. Eg. new_color

Note: this only thing I don't like about this idea is that calculated fields are not updated right away so if you change the color on the category it may not show up on the records for about 24 hours.

If Optionset - Idea 2
-Create a new Color field on your account entity of type text.
-Create a new business rule which will set the Color field when the Category optionset is changed.
-Include the new calculated Color field on your view for the Map Control
-Update the Pushpin Color Field in the properties to point to the new color field you added. Eg. new_color

Note: The thing i don't this idea is that if you decide to change the color for a category then you have to do a bulk update on all the records for that category to make sure they get changes. Because of this I think Idea 1 is a better solution but I wanted to include this as a secondary one since it is a possibility.

Let me know if this helps.

Thanks,

Rick

commented

Richard,

Thank you very much for your answers !!
Actually I didn't know what was the purpose of the property Pushpin Color Field. Now I understand.
I will try your idea 1 because my categories are in an OptionSet (I have only 3 categories, should be easy)

Thanks again, I'll let you know if this works.

Sébastien.

commented

Hi Rick,

I didn't have a chance to try your options before today... Well, your idea number 1 works perfectly with optionset and calculated field.
Thank you very much for you help and thanks again for this useful PCF control.

Sébastien.