1 2 3 4 5 6 7 8 9 10 11 | from Spotfire.Dxp.Data import DataProperty from Spotfire.Dxp.Data import DataType from Spotfire.Dxp.Data import DataPropertyClass propName = "myDocumentProperty2" attr = DataProperty.DefaultAttributes prop = DataProperty.CreateCustomPrototype(propName, DataType.String, attr) Document.Data.Properties.AddProperty(DataPropertyClass.Document, prop) prop.Value = "myDocumentPropertyValue" |
is there a way to do this where it first checks if the doc property exists? Something like
ReplyDeleteif myDocumentProperty2 exists do nothing, else ....
Got it from another forum. Here's the code if anyone needs. If the doc property already exists it just fills it with 'hello' otherwise it will create and fill the doc property
Delete----------------------------------------
from Spotfire.Dxp.Data import DataProperty
from Spotfire.Dxp.Data import DataType
from Spotfire.Dxp.Data import DataPropertyClass
if Document.Data.Properties.ContainsProperty (DataPropertyClass.Document,myProp1):
Document.Properties[myProp1] = 'hello'
else:
propName=myProp1
attr=DataProperty.DefaultAttributes
prop=DataProperty.CreateCustomPrototype(propName, DataType.String, attr)
Document.Data.Properties.AddProperty(DataPropertyClass.Document, prop)
prop.Value=myProp1Val
I have to voice my passion for your kindness giving support to those people that should have guidance on this important matter.
ReplyDelete---------------------------------
property in Italy for sale
Thanks youu for sharing
ReplyDeletegclub casino
ReplyDeleteI enjoyed over read your blog post. Your blog have nice information,
I got good ideas from this amazing blog.
goldenslot
gclub
gclub casino
Hey there! This is a great blog, I really enjoy reading this post.
ReplyDeleteLooking for the lowest price to start company? check out the best singapore company incorporation firm today!
What use would this script be for?
ReplyDeleteI enjoyed over read your blog post. Your blog have nice information. chrisbuyshomessandiego.com
ReplyDeletevery interesting blog, thank you for sharing. Realty Davao
ReplyDeleteAre you looking up for the best Real estate script mall in Chennai? As a Digital marketer and a graduate in computer science after many analysis, my choice would be Real estate script mall
ReplyDelete