Forum Discussion

TannerNordstro1's avatar
TannerNordstro1
Qrew Member
11 months ago

Button Group Conditional Display

I have a formual rich text button group that has 3-4 buttons. It all works great. I am trying to display or hide certain buttons based on the users role. For example, if current user role = "Not Smart" don't display button #2. Here is what I'm currently using to hide/display buttons based on other critera:   

var text rowOnebuttonOne = If([Job Milestone]<>"Opportunity",$onebuttonhtml,"");
var text rowOnebuttonTwo = If([Job Milestone]<>"Sold",$twobuttonhtml,"");

Is it possible to also evaluate and display based on user role? 


Much thanks. 



------------------------------
Tanner Nordstrom
------------------------------

1 Reply

  • What you could possibly do is use create a condition that uses the 'UserRoles' function. Something like

    If(Contains(UserRoles("Name"),"Not Smart")=true, etc. 

    or create it as a bool variable and for each hide/show condition use it in there like

    var bool role = Contains(UserRoles("Name"), "Not Smart";

    var text rowOnebuttonOne = If($role=true and [Job Milestone]<>"Opportunity",$onebuttonhtml,"");

    I'm sure there is a better way to make it fit into your code, but I would say that those methods should at least point you in the right direction.



    ------------------------------
    Josh Hamilton
    ------------------------------