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
07 Sep, 2023

Optimizing Storage with SubscriptionTrackingDeletedObject Cleanup

What is SubscriptionTrackingDeletedObject? The "SubscriptionTrackingDeletedObject" table is linked to the "DeletionService," which handles two types of cleanup: organization-wide and record-specific.…

READ MORE
Blogs
05 Sep, 2023

How to create real-time customer journeys in Dynamics 365 Marketing

Introduction: This blog will show how to create real-time customer journeys in Dynamics 365 Marketing. Customer journeys can be either…

READ MORE
Blogs
30 Aug, 2023

D365 CUSTOMER SERVICE: CUSTOMER 360 COMPONENT

Introduction: In Dynamics 365 (D365) Customer Service, the 'Customer 360' Component provides a comprehensive view of information and enables users…

READ MORE