I have added custom button using command bar , I need to control the visibility of the button based on the logged in user .
Logic - Button should be visible only if assigned to user is equal to the current user.
I have added below power FX code , but the code doesn't seem to work , can you please guide me where I am doing wrong.
Solved! Go to Solution.
Hi @Gayathri_TU,
This a known issue. Power FX logic for command bar have known issue with visibility and lookups. The product team is aware and will fix but not specific ETA yet. Note command bar Power FX is still in preview so might have more glitches like this. Apologies on their behalf for the inconvenience.
Cheers
Hello @Gayathri_TU
Hope you are doing good.
As per my knowledge its related to LOWER or UPPER case issue.
Try converting Both Side to Lower or Upper and Try again.
Please mark as Answer if it is helpful and provide Kudos
Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Thanks for reply , I have tired as per suggestion but still not working
Hi @Gayathri_TU ,
Couple things:
1. Does the user logged in have the permissions to view the User entity across the Business Unit or Organization? If not then when you are referencing through the 'Assigned To' it may not have the permissions to get the email field on the user.
2. You are checking Assigned To, is this a custom field on your table that is a User lookup type? I would expect you would normally be checking the "Owner"...
Hi @Gayathri_TU,
This a known issue. Power FX logic for command bar have known issue with visibility and lookups. The product team is aware and will fix but not specific ETA yet. Note command bar Power FX is still in preview so might have more glitches like this. Apologies on their behalf for the inconvenience.
Cheers
Hi @Gayathri_TU ,
It should work. Make sure you save and publish the changes done in command designer. Wait for notification you get as per below screenshot and refresh to see your changes or if you want to see your changes instantly, hard refresh your browser by pressing (ctrl + f5) multiple times.
As recommended, it is not best practice to use in production instance because it is still a preview feature. Same thing you can able to achieve using JavaScript.
If it answers your question, kindly give kudo and accept it as solution.
Regards,
Prakash
@Prakash4691 @EricRegnier @dpoggemann
Thanks for helping me out , I have achieved the same using the JavaScript code as PowerFx didn't provide desired solution .
User | Count |
---|---|
24 | |
4 | |
4 | |
4 | |
3 |
User | Count |
---|---|
27 | |
10 | |
9 | |
9 | |
7 |