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

 

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 Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,524)