SREEJAYAN cheri Posted August 26, 2019 Share Posted August 26, 2019 Hi, I have a requirement to show values based on a drop down list: Dropdown: Currency (CAD, USD) -> (Document.Property("CurrencyProperty") I have a labeldefined in the text area: Current Authorization: I have captured the 2 column values from the data table, in 2 different document properties: Document.Properties("CurrentAuthUS"), Document.Properties("CurrentAuthCAD") Is there anything that I can do in ironPython, so that when the user selects the drop down value, I can display the appropriate value: something like: if (${CurrencyProperty}='CAD', $Document.Properties("CurrentAuthCAD"),Document.Properties("CurrentAuthUS")) I believe a simple if statement should do it, but have been struggling to get it ... any help appreciated. Thanks Link to comment Share on other sites More sharing options...
Antoine Doeraene Posted August 28, 2019 Share Posted August 28, 2019 If I understood correctly what you're trying to achieve, I believe in the IronPython script you can simply do: if Document.Properties["CurrencyProperty"] == "CAD": Document.Properties["CurrentAuth"] = Document.Properties["CurrentAuthCAD"] elif Document.Properties["CurrencyProperty"] == "USD": Document.Properties["CurrenAuth"] = Document.Properties["CurrentAuthUSD"] else: raise Error("Unkown CurrencyProperty: `" + str(Document.Properties["CurrencyProperty"] + "`.")Another more fancy way would be: Document.Properties["CurrentAuth"] = Document.Properties["CurrentAuth" + str(Document.Properties["CurrencyProperty"])] Link to comment Share on other sites More sharing options...
SREEJAYAN cheri Posted September 23, 2019 Author Share Posted September 23, 2019 Thank you. Works! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now