cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kev_Houston
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
WarrenBelz
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.

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.

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

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.

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?

Hi @Kev_Houston ,

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

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (1,916)