Skip to main content
1-Visitor
May 9, 2018
Question

Get style information of style definition

  • May 9, 2018
  • 1 reply
  • 2001 views

It it possible to get style information of a style definition entity in a service?

1 reply

5-Regular Member
May 16, 2018

Hi @drichter I don't see any OOTB service available for this, would it be possible for you to share short comment on what the use case is?

1-Visitor
May 16, 2018

Digging a bit with the services, if you use GetDifferencesAsJSON service you can get difference styling between a base style and the given one, you get something like this where you can get the styling, crappy but it can work:

 

Screenshot 2018-05-16 11.55.30.png

1-Visitor
May 16, 2018

Sorry it's the old value, your code should look something like this:

 

// -- where styleName contains the Style Name for which you want to recover style content
var data = StyleDefinitions[styleName].GetDifferencesAsJSON({ otherEntity:"DefaultMashupStyle" });
var result =data.rows[data.rows.length-1].difference.rows[0].oldValue.value;