Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/How do I use a variable from the daml.yml file in my code?Forum ↗

How do I use a variable from the daml.yml file in my code?

App Development3 posts77 views1 likesLast activity Feb 2025
CO
cohen.avrahamOP
Feb 2025

G-d willing

Hello,
I would like to use the debug function to print the package’s version from its daml.yaml file.
How can I do that?

WA
WallaceKelly
Feb 2025

I cannot think of a built-in way to accomplish this. :thinking:

  • There’s nothing like reflection in Daml.
  • There’s no access to environment variables.
  • There’s no access from within Daml to call Ledger API endpoints.

Do you need this from a choice implementation? Or from Daml Script?

What about hardcoding a version identifier into the Daml code? And updating it with each release? :man_shrugging:

CO
cohen.avraham
Feb 2025

G-d willing

Thanks @WallaceKelly for your response.
Well, I need that from within a choice.
This is related to some upgrade’s coding related to SCU
As for hardcoding, I thought about that, and I planned on doing it that way if there wasn’t any other way.

← Back to Discussions