cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

Condition if clicking on an Edit Button

Hi, I have this condition, it is returning error as type of argument not valid:

 

If(DataCardValue44.SelectedItems.DisplayName=User().FullName, DisplayMode.Edit, DisplayMode.View)

 

What I want is that quen some one click de Edit Button it becomes editable only if de User name is the same deployed in the DataCardValue44 andi if not then don´t allow to edit.

 

Thanks for your help!

 

1 ACCEPTED SOLUTION

Accepted Solutions

@AllisonCruz 

Ah language...looks like you need to utilize semicolons rather than comas in your formulas.

Try this:

If(DataCardValue44.Selected.Value=User().FullName; DisplayMode.Edit; DisplayMode.View)

Also, since you have only Choices for the DataCardValue44 items, then your only column available for compare would be the Value column.

See if the above gets you further.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

5 REPLIES 5
Super User III
Super User III

@AllisonCruz 

Consider changing your formula to the following:

If(DataCardValue44.Selected.DisplayName=User().FullName, DisplayMode.Edit, DisplayMode.View)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

It´s now sending an error: invalid number of arguments and unexpected characters 😞

@AllisonCruz 

Can you please supply some screenshots and also some of your formulas?

Of particular interest are the DisplayMode property you are trying to change and the Items property of DataCardValue44.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

AllisonCruz_0-1600117560579.pngAllisonCruz_1-1600117654738.png

AllisonCruz_2-1600117770038.pngAllisonCruz_3-1600117811324.png

 

 

@AllisonCruz 

Ah language...looks like you need to utilize semicolons rather than comas in your formulas.

Try this:

If(DataCardValue44.Selected.Value=User().FullName; DisplayMode.Edit; DisplayMode.View)

Also, since you have only Choices for the DataCardValue44 items, then your only column available for compare would be the Value column.

See if the above gets you further.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (23,427)