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
Solved! Go to Solution.
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.
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.
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
274 | |
245 | |
83 | |
37 | |
34 |
User | Count |
---|---|
359 | |
245 | |
127 | |
73 | |
44 |