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

Blogs
30 Sep, 2024

SMS Integration with Twilio Number in D365 Customer Service- Part 1

Introduction Integrating SMS functionality into Dynamics 365 can significantly enhance customer communication by providing a direct and efficient channel for…

READ MORE
Blogs
24 Sep, 2024

White Box Testing - Its Techniques and Types

In this blog, we’ll deal with one of the most popular methods of testing a system or system component thoroughly…

READ MORE
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