web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / use environmental vari...
Power Apps
Unanswered

use environmental variable in business rule?

(0) ShareShare
ReportReport
Posted on by 217

How do I refer to an environmental variable from inside a business rule? Or is this not possible? 

 

I've created an environmental variable called stdCutoff  in my solution. It contains a number. I have a Dataverse table CustomCutoffs where different teams can set their personal cutoff values. Most teams won't bother to create a custom cutoff. But if they do, I want a business rule that sets its default value to stdCutoff.

 

If I can't do this from inside a business rule, is there another way?

 

 

I have the same question (0)
  • Verified answer
    Drew Poggemann Profile Picture
    9,287 Most Valuable Professional on at

    Hi @halifaxious ,

     

    Environment variables can not be accessed from business rules or classic workflows so you could run a flow on the creation of the record and lookup the environment variable and set the value in the record.  This is asynchronous of course and would not show as they create the record.  

     

    Business rule could set the value (or default the value of the field) but you would need to set the date in the business rule, which would not be environment specific of course.

     

    Hope this helps.  Please accept if answers your question or Like if helps in any way.


    Thanks,


    Drew

  • halifaxious Profile Picture
    217 on at

    hmm... sounds like environmental variables won't be very useful inside model-driven apps, at least not without coding something custom.

     

    Have you seen any good examples of non-data-source environment variable use in the wild? MS docs only include the suggestion to store a pointer to a data source so that app installers can over-ride it in their own environments. I've stored a decimal number and there doesn't seem to be any good way to use it.

  • Ram Prakash Duraisamy Profile Picture
    5,593 Super User 2025 Season 2 on at

    Hi Halifaxious,

     

    Trigger a Javascript and get the environment value, then later based on the condition or field, set the retrieved value or allow the user to enter the value.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard