knowledgecenter-breadcrum

Knowledge Center

30 May, 2022

How to show or hide ribbon buttons using Power Fx formula?

Posted on 30 May, 2022 by Admin, Posted in Dynamics 365 Power Apps Dataverse Power Platform Dynamics-365 Sales

How to show or hide ribbon buttons using Power Fx formula? Blogs

How to show or hide ribbon buttons using Power Fx formula?

Introduction

I recently found out that we can add or edit ribbon buttons/command bar in PowerApps itself.

Add Ribbon Buttons and Edit Command Bar within Power Apps – Dynamics 365
<iframe class="wp-embedded-content" data-secret="HPQ4nI2OxE" frameborder="0" height="338" marginheight="0" marginwidth="0" sandbox="allow-scripts" scrolling="no" security="restricted" src="https://nebulaaitsolutions.com/add-ribbon-buttons-and-edit-command-bar-within-power-apps-dynamics-365/embed/#?secret=HPQ4nI2OxE" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);" title="“Add Ribbon Buttons and Edit Command Bar within Power Apps – Dynamics 365” — Nebulaa IT Solutions" width="600"></iframe>

I had the habit of customizing ribbon buttons using ribbon workbench, but this time I thought of doing it in PowerApps itself.

I found out that in PowerApps we have to use Power Fx formula for determining the visibility of ribbon buttons.

Solution

After a bit of research I could build this formula.

If(Self.Selected.Item.Status = ‘Status (Marketing Requests)’.Active, true, false)

Example

I have created two buttons ‘Approve‘ and ‘Reject‘ which will be hidden when the status of the record is Inactive.

Click on the button and a command panel will open in left hand side.

Scroll down in the command panel until you find ‘Visibility‘ option and select ‘show on condition formula‘. Add this formula in the textbox which has fx as a label and then click on ‘Save and Publish

If(Self.Selected.Item.Status = ‘Status (Marketing Requests)’.Active, true, false)

After publishing we can see that the buttons are not visible when the record is inactive.

Comment

This is a Required Field

Loading

Recent Updates

Thumbnail D365 Sales
Blogs
09 Apr, 2025

What Is Dynamics 365 Sales? A Comprehensive Guide

What Is Dynamics 365 Sales? A Comprehensive Guide Microsoft has become a leader in business applications with its suite of…

READ MORE
Blogs
02 Apr, 2025

Quality is not just an option; it’s a responsibility

In the world of software development, testing is often seen as an optional phase, especially when there is no dedicated…

READ MORE
Thumbnail
Blogs
26 Mar, 2025

What is Power Virtual Agents: Exploring AI-Driven Virtual Chatbots?

What is Power Virtual Agents: Exploring AI-Driven Virtual Chatbots? In today’s digital landscape, businesses are constantly seeking ways to enhance…

READ MORE