cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
G99
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

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
WarrenBelz
Super User III
Super User III

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.

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
   )

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
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 Apps Community Call

Monthly Power Apps Community Call

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

secondImage

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 the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (70,129)