knowledgecenter-breadcrum

Knowledge Center

22 Oct, 2020

Environment Variable in CDS

Posted on 22 Oct, 2020 by Admin, Posted in Dynamics 365 , Dynamics-365 Sales

Environment Variable in CDS Blogs

Environment Variable in CDS

Introduction

In this blog, we will see the behavior of Environment Variable in CDS environment.

There are scenarios where we need some set of configurable values in our CDS instance. Such as Product Key, Endpoint URL etc.

With the extended capability of PowerApps, now we have a provision to create an Environment Variable in our CDS instance.

Details about environment variable

In CDS instance when we click the “+New” button, then Environment Variable option is available as shown in below screenshot:

Upon Clicking on “Environment Variable” below screen will appear.

Here, we can specify the Name, Description and Data Type. Currently only four types are available for Environment Variable as shown in above screenshot.

For e.g. I have created a string type field with below details.

In CDS instance the Environment Variable Details get stored in below tables:

  1. Environment Variable Definitions (logicalname: environmentvariabledefinition)

Description: This table stores the definitions about “Environment Variable” as shown in below screenshot:

  1. Environment Variable Values (logicalname: environmentvariablevalue).

Description: This table stores the value associated to “Environment Variable”.

Just For Information,

  1. If we do not add the current value during field creation, then only one record will be created in “Environment Variable Definitions” table.
  2. Later, when we add the value in current value field of environment variable, then one record will be created under “Environment Variable Values”.

Let see this,

  1. Without Current Value: I have created below field without current value.

But no record will be created in “Environment Variable Values” table as shown below:

  1. Add value in Current Value:

Deployment

When we deploy the environment variable to other instance then for the first time it will ask to set the value and by default it shows the value of source instance.

Next time if we update the value in source system, then in target system it will not update the latest value. It only shows the old. Hence we have to update the target values manually.

Note: We can use the environment variable in power automate, plugin, scripts same as tabled value using FETCHXML concept.

Comment

Loading

Recent Updates

Thumbnail D365 for Marketing
Blogs
16 Dec, 2024

10 Reasons Why You Need Dynamics 365 for Marketing

This blog discusses the top 10 reasons to choose Dynamics 365 for Marketing to improve your business's marketing efforts.  …

READ MORE
Thumbnail_top 10 benefits of
Blogs
02 Dec, 2024

Top 10 Benefits of Microsoft Dynamics 365

This blog lists the advantages of Microsoft Dynamics 365, focusing on how it can improve your business operations.    …

READ MORE
Thumbnail_Microsoft365 Vs D365
Blogs
12 Nov, 2024

Microsoft 365 vs Dynamics 365

This blog will help you understand the key difference between Microsoft 365 and Dynamics 365, so you can make an…

READ MORE