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 Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (30,179)