Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Is there anything in DAML which work like Global variable in any other programming language?Forum ↗

Is there anything in DAML which work like Global variable in any other programming language?

App Development3 posts448 views5 likesLast activity May 2020
NI
Nishchal_VashishtOP
May 2020

i am making on application on insurance where client is coming with their Request and making CLIENTREQUEST Contract. CLIENTREQUEST Template looks like this :

template CLIENTREQUEST 
  with
    amount_required :Int
    client : Party
    list_of_insurance_provider :Party
  where
     signatory  client
     observer list_of_insurance_provider

My problem is that now client has to provide list of lender and i want to remove this burden from client head.

Is there any way ?

DR
drsk
May 2020

Hi @Nishchal_Vashisht, I’m not sure I understand the question. But what you can do to have data available to both parties is to store it in a contract that is observed by both of them. Does that help?

MA
Martin_Huschenbett
May 2020

Hi @Nishchal_Vashisht, thanks for trying DAML. As @drsk said, using contracts as global variables is the right approach. If you need the content of this contract to change over time but also require stable references to it, contract keys would be the right way to go: https://docs.daml.com/daml/reference/contract-keys.html

← Back to Discussions