cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Wapfunz
Level: Powered On

EditForm on submit also set a flag in the SharePoint List

Hi,

 

I am using the one editform for new items and editing older records.

 

 

 

When the form is a new item, the flag (column) on the list is 0 (by default) then the form captures the users Name and email.

On submit it sets this flag to = 1 - that is the plan.

So that if the record is in edit mode and the record is to be updated it will not recapture the Name and email on opening - the original is shown.

 

e.g 

If(ThisItem.Flag = 0 And EditForm1.Mode=FormMode.New,User().Email, ThisItem.PreparedBy)

and

If(ThisItem.Flag = 0 And EditForm1.Mode=FormMode.New,User().FullName, ThisItem.PreparedBy)

 

Both these work - which surprised me as it was a stab in the dark to code it from an example or two.

 

Is there a way of adding to the function - Submit - to set a flag (column to 1)

 I have tried this (following) only on the OnSelect Action - but  get an eror warning icon.

 

ThisItem.Flag = 1 AND  SubmitForm(EditForm1)

 

Trying to replicate InfoPath where on submit you set a rule etc.

Or should I create a rule that says something like if Flag = 0 then set flag =1 then submit.

Now how do I do that? - mmmmmmmmmmmmmmmmmm

 

Suppose other option is to create two edit forms - One for new one ofr edit record - but then still would have same problem of setting the Flag on submit.


Accepted Solutions
Super User Rank
Super User

Re: EditForm on submit also set a flag in the SharePoint List

Hi @Wapfunz,

You would use the OnSuccess property of the form to set the flag. Perhaps using a Patch() function.  The syntax would be Patch(datasource,EditForm1.LastSubmit,{FlagField:1}).   


All Replies
Super User Rank
Super User

Re: EditForm on submit also set a flag in the SharePoint List

Hi @Wapfunz,

You would use the OnSuccess property of the form to set the flag. Perhaps using a Patch() function.  The syntax would be Patch(datasource,EditForm1.LastSubmit,{FlagField:1}).   

Wapfunz
Level: Powered On

Re: EditForm on submit also set a flag in the SharePoint List

Cheers and Thank you