Skip to content
LearningPathX
Learning PathsFree TestsExam InfoHow it worksNews
Sign inChoose a certification
  1. Home/
  2. Certifications/
  3. AB-400/
  4. AB-400 Learning Path/
  5. Study FAQs/
  6. When should I use Power Fx or JavaScript for a model-driven command?

Study FAQ

When should I use Power Fx or JavaScript for a model-driven command?

Exam · AB-400Knowledge domain · Extend the user experience (25–30%)Updated Nov 25, 2026
Also asked as 2
  • Should I use Run formula or a JavaScript action in the model-driven command designer?
  • How do I choose a model-driven command action and test its selection behavior?

Answer

Use Power Fx when a supported formula can express the command's action or visibility. Choose JavaScript for an action that needs the model-driven Client API or explicit asynchronous coordination. Check the command's location and selection contract first.

For example, a reminder can run a formula such as Notify("Review the saved credit hold before requesting approval."). Give the command accessible text, save and publish, and wait for the command component library to finish publishing. Refresh the running app and test with an intended user who has the app and command library access and the relevant Dataverse roles.

Check main form, main grid and subgrid behavior separately. An action expecting one row should require exactly one selection. Power Fx commanding has a default form-buffer AutoSave behavior. Test that behavior and the supported formula functions at the actual command location before promising that a button leaves unsaved edits alone. Treat command visibility as a display decision and enforce permission at the operation.

Command designer overview · Power Fx in model-driven commands

Full explanation

AB-400: Client Scripting and Commands in Model-Driven Apps

Study guide · AB-400

Read the full explanation →
← Back to AB-400 FAQsView learning path →

Related questions

How do I use environment variables for a code app's data source? →How do I read Dataverse table metadata in a Power Apps code app? →How do I deploy a Power Apps code app into a specific solution and share it? →How do I initialize and run a Power Apps code app locally? →How do I find what is slowing down a Power Apps code app? →How can a model-driven JavaScript command read a saved row instead of unsaved form values? →
LearningPathX

A focused path to certification, one clear step at a time.

© 2026 LearningPathX. All rights reserved.

Product

CertificationsLearning PathsFree TestsHow it worksNews

Company

SubscriptionHelp centerContact usPrivacyTerms

Follow us

Your privacy choices

We use analytics cookies to understand how LearningPathX is used and improve your learning experience. Analytics will only start after you accept.