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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Evaluate business rule...
Power Apps
Unanswered

Evaluate business rules via API (eg. for PCF controls)

(0) ShareShare
ReportReport
Posted on by 2

Suggestion is to be able to retrieve & evaluate business rules for an entity (eg. via WebAPI) so the outcomes can be handled in a variety of contexts.

 

What prompted the thought is when developing a very complex PCF control for our specific use case, I found I had to replicate the logic which would show/hide/lock etc. fields. Instead it would be awesome to retrieve any (entity-scoped?) business rules for an entity through an API call, then for each one execute another API call which would evaluate the rule and return a list of outcomes (eg. [ { column: "pub_myattributename", action: "hide" }, { column: "pub_myotherattribute", action: "setValueToColumn", columnWithValue: "pub_someotherattribute" } ].

 

The PCF control could then handle these actions as desired, but it would be a simple matter to handle show/hide actions etc. This could probably be combined with PCF parameters to make some generic components which honoured business rules.

 

This evaluation of the rules would ideally be just an evaluation (eg. if a business rule would clear the value of a field, calling the API to evaluate the rule wouldn't clear the field again, but would report back to the user what action would be taken given the current record state/data.). Optionally the evaluation call might require the caller to provide an "event" eg. specify a field which has "changed". Optionally, the API call may in fact allow the rule to be executed and not just evaluated.

 

If it were implemented as an API, it would be extremely flexible and have many more applications - such as being able to call & respond to the rules via client Javascript, PowerFX, Plugins & Custom Workflow Activities, Canvas Apps, Power Automate etc. Consider that Actions, Power Automate flows and other components can be invoked in a similar way eg. by posting messages using the SDK or calling http endpoints.

 

This way, we would not only open many more exciting functional possibilities, but would also significantly reduce maintenance and bugs by centrally locating a lot of business logic.

I have the same question (0)
  • cchannon Profile Picture
    4,702 Moderator on at

    That seems pretty elaborate. Why not just have business rules that fire on change of the bound attribute for your PCF?

  • quirkybird Profile Picture
    2 on at

    That would be a nice option as well.


    Two reasons I took it further: 

     

    1. If the PCF uses attributes that aren’t bound (eg. If the PCF attaches to a dataset but also pulls in & displays fields from related records to provide a better user experience).

     

    2. The idea described above goes well beyond PCF controls… eg. Use the same principles and APIs on canvas apps, Powerapps Portals page forms and so on.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard