cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How to display button as a function of User credentials

Hi,

 

I have a view form with an edit button redirecting towards an edit form,

 

I want this button to show only if the "Domaine" value of the user list is the same as the "Equipe Principale" datacard value of the view form (link to another list in SharePoint),

 

I tried this formula on the visible property of the button :

If(Domaine.Text = DataCardValue2_1.SearchText,true,false)

 

This formula doesn't seem to work,

 

I have put screenshots of my app and list in attachments, 

 

Thanks for helping,

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Anonymous 

What kind of control is this Datacardvalue? Is it a text input? A combobox?

It depends on what it is. In case of text input you use 'DataCardValue2_1.Text', in case of combobox you use DataCardValue2_1.Selected.Text

 

View solution in original post

8 REPLIES 8
VDS_Mantra
Resolver I
Resolver I

Hi,

 

Try this If(DataCardValue2_1.Text ="Equipe Principale" ,true,false)

 

Hope it will help. 

SkiDK
Solution Sage
Solution Sage

Hi @Anonymous ,

I think you just have to use next:

If(Domaine.Text = DataCardValue2_1.Text, true, false)

 

Anonymous
Not applicable

Thanks for your answer SkidK but I have tried this and it return me an error (see attachment)

Anonymous
Not applicable

Hi VDS , your formula will not work "Equipe Principale" is the label of the datacard, I want to check if the value of this same datacard is equal to the User's Domaine .

Hi @Anonymous 

What kind of control is this Datacardvalue? Is it a text input? A combobox?

It depends on what it is. In case of text input you use 'DataCardValue2_1.Text', in case of combobox you use DataCardValue2_1.Selected.Text

 

View solution in original post

Sergiu_S
Regular Visitor

Hi,

 

please try If(DataCardValue2_1.SearchText in Domaine.Text ,true,false) I've run into simmilar issues a couple of times and this always worked for some reason, even though there is no obvious reason for me as to why.

 

Sergiu

Anonymous
Not applicable

It's a combo box, I actually tried DataCardValue2_1.Selected.Text but Text isn't valid so I put value instead and it works perfectly,

 

Thanks for helping @SkiDK  !

Anonymous
Not applicable

Hi @Sergiu_S ,

 

I have already tried that, and even if it doesn't show errors, it still doesn't work,

 

What works in my case (because the field is a combo box) is 

DataCardValue2_1.Selected.Value
 
 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (2,451)