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.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
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}).   

2 REPLIES 2
Super User
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

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 212 members 4,847 guests
Please welcome our newest community members: