cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Prevent field update in edit mode

Hi 

I have the title field of a SharePoint list form modified in PowerApps as

"Daily Checks - Compiled by - " & User().FullName & " - " & Text(Today(), "[$-en-US]dd/mm/yyyy")

Is there an approach you can recommend to prevent the recalculation of the above when the form is revisited in View or Edit mode?

I've failed by attempting to use a Variable against the SharePoint Integration submit, and by appending with If FormMode=New.

I want the field to be set at New and not further updated.

Thank you!
Kev

7 REPLIES 7
Highlighted
Super User III
Super User III

Hi @Kev_Houston ,

A variable is the only way to go - on OnSave

If(
   YourFormName.Mode=FormMode.New,
   Set(
      vMyTime:
      Text(Today(), "[$-en-US]dd/mm/yyyy")
   )
)

You can then refer to the Variable which will not change unless a new record is submitted.

 

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.

Highlighted

Hi @Kev_Houston ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

Highlighted

Hi @WarrenBelz 

Thanks for the support!

I've attempted to implement your suggestion, Attempting to also include the necessary text, along with the user and date capture/format.

I've tried the following within the OnSave of the SharePointIntegration

If(
SharePointForm1.Mode=FormMode.New,
Set(
VarMyTitle:
Text("Daily Checks - compiled by - " & User().FullName & Today(), "[$-en-US]dd/mm/yyyy"), SubmitForm(SharePointForm1)
)
)

The above generates errors
var config/errorsvar config/errors

 

Can you see where I am failing in the format of the onsave variable?

Thanks
Kev

Highlighted

Hi @Kev_Houston ,

The correct syntax is

If(
   SharePointForm1.Mode=FormMode.New,
   Set(
      VarMyTitle,
      "Daily Checks - compiled by - " & User().FullName & Text(Today(),"[$-en-US]dd/mm/yyyy")
   );
   SubmitForm(SharePointForm1)
)

 

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.

Highlighted

Hi @WarrenBelz 

Thank you.

I've been able to set the variable as per the OnSave instructions applied to the SharePointIntegration option.

The behaviours I am finding is the populated Title field, which contains the VarMyTitle only displays to the initial form creator/submitter once opened in display mode (its fine in the column value in SharePoint list view), and attempting to edit the form further, neither the submitter or another user are able. No errors/prompts occur when using the save button, but the save does not commit back to the SharePoint list. Any ideas?

Highlighted

Hi @Kev_Houston ,

A different subject to your post but are you saying once written you cannot edit the record?

Highlighted

Hi @Kev_Houston ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (9,312)