cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Prodigy
Post Prodigy

If fx help

Hi

Struggling a bit with the syntax

I have a form, I would like to allow only a user selected in DatacardValue27_1 to be able to edit it, but if the form is completed, I've set it to go into View mode, but I cannot set the save button to disabled.

Currently on the Save Button DisplayMode property I have:

 

If(VarUser = DataCardValue27_1.Selected.Email, DisplayMode.Edit,DisplayMode.Disabled ||If(Form1.DisplayMode=DisplayMode.View, DisplayMode.Disabled, DisplayMode.Edit))

 

Issue with this is on an item which is set to DisplayMode.View the button is still clickable, although the form is in not editable even by the logged in user who is selected in the datacard (VarUser)

 

I've tried this also but get a red line error:

 

If(VarUser = DataCardValue27_1.Selected.Email, DisplayMode.Edit,DisplayMode.Disabled, If(Form1.DisplayMode=DisplayMode.View, DisplayMode.Disabled, DisplayMode.Edit))

 

I'd like the save button to be disabled even if the logged in user is the person selected in the datacard, IF the form has been set to ViewMode

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: If fx help

Hi @G99 ,

I was in syntax modifying mode rather than code examination mode - I will add some foolproof code as well. I assume you have this on the DisplayMode of the button.

If(
   Form1.Mode = FormMode.View
   DisplayMode.Disabled
   If(
      VarUser = DataCardValue27_1.Selected.Email
      DisplayMode.Edit,
      DisplayMode.Disabled
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

3 REPLIES 3
Highlighted
Super User III
Super User III

Re: If fx help

Hi @G99 

Try

If(
   VarUser = DataCardValue27_1.Selected.Email &&
   Form1.DisplayMode <> DisplayMode.View
   DisplayMode.Edit,
   DisplayMode.Disabled
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Highlighted
Post Prodigy
Post Prodigy

Re: If fx help

Hi @WarrenBelz 

 

The same behaviour as I had with my fx, it sets the item to view mode, but the button stayed clickable and not disabled:

 

If(
    VarUser = DataCardValue27_1.Selected.Email &&
    Form1.DisplayMode <> DisplayMode.View,
    DisplayMode.Edit,
    DisplayMode.Disabled
   )

Highlighted
Super User III
Super User III

Re: If fx help

Hi @G99 ,

I was in syntax modifying mode rather than code examination mode - I will add some foolproof code as well. I assume you have this on the DisplayMode of the button.

If(
   Form1.Mode = FormMode.View
   DisplayMode.Disabled
   If(
      VarUser = DataCardValue27_1.Selected.Email
      DisplayMode.Edit,
      DisplayMode.Disabled
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (4,921)