web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

How to hide a button depending on value of look up field

(0) ShareShare
ReportReport
Posted on by 40

I'd like to hide a custom button created in ribbon workbench when a Contact that is added to Reservation doesn't have any email. I know that I have to use java script, but I totally don't know how. Could anyone help me? 

I have the same question (0)
  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    Hi,

    If you are new to java script, you can start from Dataverse Rest builder from xrmtoolbox where you can generate script to fetch contact email based on the contact id github.com/.../DRB

    once you have that script you need to use that script  under promise to hide and show your button based on the email found or not, you can refer below sample which is a different use case but you need to use your script in similar manner.

    debajmecrm.com/.../

  • Richard_S Profile Picture
    75 on at

    Hello alqueen,

    you could try to insert your button via the new model-driven app designer in your command bar. Then set the visibility Property of the button via Power FX formula.

    Should look something like this imo:

    If(IsBlank(Self.Selected.Item.'Contact.'E-Mail'),false,true)

    where 'Contact' should be the lookup to your related Entity and 'E-Mail' the field in this Enity you want to check.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 174

#2
ManoVerse Profile Picture

ManoVerse 54 Super User 2026 Season 1

#3
Niki Patel Profile Picture

Niki Patel 42

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans