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

Case Study
06 Sep, 2024

Implementation of Business Central for a Trading Organization

Customer Overview A prominent trading organization sought to enhance its operational efficiency and streamline its business processes by implementing Dynamics…

READ MORE
Blogs
03 Sep, 2024

Optimizing Code Check-ins: Ignoring Unnecessary Files for a Cleaner Azure DevOps Repo.

Introduction In this blog, we will learn about the code check-in process in DevOps. After development, unnecessary files are sometimes…

READ MORE
Blogs
20 Aug, 2024

Configure Macros in Omnichannel to improve Agent Productivity

What are Macros? Macros are a set of sequential actions that a user performs. They enable users to perform daily…

READ MORE