Is there any way that I can enable fields(which are diabled on edit) for those user who saved form as a draft?

  • 22 September 2017
  • 15 replies
  • 4 views

Badge +5

I have a question on the form that I created I have some fields on my form those were disabled on edit.

I have button called save ( it saves the details of the form like draft , don't trigger any workflows in the background) So, whenever a user saves the form as a draft they cannot edit the form( I disabled those fields as per the requirement) Now, is there any way that I cannot disable those fields for only the user who saved it as a draft?


15 replies

Userlevel 5
Badge +13

Are you handling the "save as draft" with a column that has a value of either "save" or "submit"? As in, when I have a "save as draft" button, I have that button write to a column "draft" and have my workflows trigger only if that column == "submit." If so, add to your rule "current user == modified by && column == draft" like so:

208013_pastedImage_1.png

Badge +5

yes, I have a column named save and the return value is 0.

for the submit button the return value is 1 and the workflows run when submit=1.

I tried to construct a formula as you described , I use SharePoint 2013 in my Formula builder I did not see ANY RUNTIME FUNTIONS/COMMON FUNTIONS  named Login ID , Modified By, wfStart functions.

Please bare with me I am really new at this.

Thanks,

Rams.

Badge +5

Apologies, I just realized that Wfstart is a column name , "save" in my case .

How can I get modified by function( I still do not see it in my formula builder)

any help much appreciated..!!

Thanks,

rams

Userlevel 5
Badge +13

No problem! We all had to start somewhere happy.png 

For you, in 2013 you will have a runtime function called userEquals , so you would have submit == 0 && userEquals(currentUser, modified by)

The "Modified By" should be in "Item Properties," as it's a native SharePoint column. I see from your other comment that you see that wfStart was just my column, you can use "submit" if that's what your column is called. I'm in O365, so I may hit a wall on how far I can assist you, but you can also check out the Nintex Help area for your product: https://help.nintex.com/en-US/nintex2013/help/#Forms/RootCategory/Nintex.Forms.RootCategory.htm%3FTocPath%3DForms%7C____… 

That gives a full listing of all the actions, functions, etc in Workflow and Forms 2013

Badge +5

Hi

Thank you for having great patience towards me,

I still have questions ...

I want to "enable" the fields for the user who saved as a draft.

I guess I have to write this formula in reverse

I mean Save!=0 && !userequals(current user, modified by) correct?

If not, please enlighten me.

I really appreciate your help so far.

Thanks,

Rams

Userlevel 5
Badge +13

So you want them visible to everyone, but only editable by the user who submitted it?

Then you will need to open the Control settings for the control you're enabling. Under "Appearance," there is a field called "Enabled". You will need to select "Expression' from this and make your formula there.

208550_pastedImage_1.png

Rules can show/hide controls, or validate them (usually making fields required conditionally), but not enable/disable them.

Badge +5

Hi Courtney Vargo,

Once again, I really appreciate your patience towards me!!!

Since I am using SharePoint 2013, I did not see the function( user equals, display name in inline function, Item properties, common) that you have shown in the above picture.

I tried the two formulas ( Please see attached)

 since save is the button that I am using, which is connected to save column in the background that returns 0 and there is other button on the form that connected to the field submitted in the background which returns 1( just explaining in case if I miss any thing).No luck sad.png

may be my whole process or syntax of my formula is wrong ?

Please let me know!!.

Once again, I really appreciate for coming forward to help me!!

Thanks,

Rams

Userlevel 5
Badge +13

I'm pretty sure the fn-Equals doesn't work for people picker type fields. You can just type userEquals and try it. If you want to see what type of value is returned (should be boolean) you can add a Calculated Value field to your form and just put userEquals(Current User, Modified By) and make sure it's returning something. You can also add calculated fields and have the formula be Current User to see what it's returning for that.

I'm not in 2013, personally, so I've only heard about the userEquals function, I'm pretty sure from ‌ or possibly

Badge +16

would this work?

fn-And(fn-IsCurrentUser(Modified By), fn-Equals(Save, "1"))

Badge +5

Hi

Thank you for reaching me out.

I tried your formula that you have shown me.. no luck.

I tried your method to ... no luck..

Any help much appreciated!!

Thanks in Advance.

Rams

Userlevel 5
Badge +13

Can you put some screenshots to show what result you're getting? Did you try to put a calculated field with the formula so you can see the result? If so, what result did you get?

Badge +5

Hi Courtney Vargo

Yes, I tried using calculated value it returns false

I have 15 to 16 fields on my form that I want them to be enabled only to the user who saved the form as a draft.

For now I tried the rule on one field

 please find the screen shots

Save  button settings

I have also tried the formula user equals in the control settings of the field it did not work( in the sense it did not let me edit and I am the one who saved the form as draft

Please let me know if I am wrong ( or my settings are wrong), also please let me know if you need more details from me.

Thank you for all your help, I really appreciate it.

Thanks,

Rams

Userlevel 5
Badge +13

In the "modified by" field of your item, are you listed there? Did you also make calculated value fields that are simply "Current User" and "Modified By" to see what those values look like?

Badge +5

Hi ‌,

Yes,

I used userequals(currentuser, modifiedby) on to the calculated value

it shows false.

I have found a workaround ( my co-worker helped me with the workflow).

I wanted to share with you ( in case if any one might find helpful)

 created this workflow in the background

see the attached

and then I constructed a formula on the form

Its working fine for now...!!

Please do let me know about your thoughts...

Once again,  I really appreciate every one helping me out in this( seriously, you have no idea how much I appreciate this conversation happy.png grin.png)

Userlevel 5
Badge +13

Hey Rams, glad you were able to get to a solution! What I meant when I was asking about the "Did you also make calculated value fields that are simply "Current User" and "Modified By" to see what those values look like?" was something like this:

208760_pastedImage_1.png

and 

208762_pastedImage_3.png

Which in editor looks like:

208761_pastedImage_2.png

And in Edit looks like:

208763_pastedImage_4.png

That way, you could see if Current user and Modified By truly matched or not.

Reply