web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / EditForm on submit als...
Power Apps
Answered

EditForm on submit also set a flag in the SharePoint List

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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.

Categories:
I have the same question (0)
  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous,

    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}).   

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Cheers and Thank you

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 477

#2
WarrenBelz Profile Picture

WarrenBelz 341 Most Valuable Professional

#3
11manish Profile Picture

11manish 317

Last 30 days Overall leaderboard