cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
victorwc
Frequent Visitor

Need help: One "Save" click causes several versions of sharepoint list item

I have created one ticketing help desk with sharepoint custom list + Flow + Powerapp.

User can create a request from powerapp form and attach any file, and then helpdesk user will reply it with an append-only comment field to communicate with user.

 

Meanwhile, I am using Flow to trigger "send an email" when "sharepoint list item is created or updated". In the mail, it will contain the latest Append-Only Comment.

 

Now the problem is that, after users attach new attachment and add new comment to the Append-Only comment field, when they click "save", it will cause 3-4 versions of list items.

First, this will causes too many mails. Second, even I add some conditions in Flow to reduce to one mail, I cannot get the latest Append-Only Comment, because the latest saved version is blank for Append-Only Comment.

 

I suppose this is because that when the attachments are uploaded, they will cause one version for each file. So I am wondering if I can change the order of saving all these versions, to let attachment be uploaded first, then, let Append-Only Comment be saved last.

 

Can anyone help?

 

Sample: 2 attachments added and 1 Append-Only Comment added in one "save"

キャプチャ.JPG

 

 

 

4 REPLIES 4
v-xida-msft
Community Support
Community Support

Hi @victorwc ,

Could you please share a screenshot about your flow's configuration?

Do you add a "Update Item" action within your flow? Do you add the "When an item is created or modified" trigger as the Trigger of your flow?

 

Based on the issue that you mentioned, I think this issue may be related to your flow's configuration. I suppose that you have added a "Update Item" action within your flow which use the "When an item is created or modified" trigger as the Trigger, is it true?

 

If you add a "Update Item" action within your flow, when the "Update Item" action is executed successfully, your flow would be fired again (Due to the "When an item is created or modified" trigger).

As an alternative solution, you could consider add the "When an item is created" trigger within your flow as the Trigger instead of the "When an item is created or modified" trigger, then check if the issue is solved.

 

If you also want to fire your flow when an item is modified, please consider take a try with the following workaround:

1. Add a Yes/No type column called "IsModified" within your SP list, and set the Default value to false.

2. Then configure your flow as below:2.JPG

 

3.JPG

4.JPG

Within the "Condition" action, add two condition rows, which combined with Or operator. For first condition row, left input box set to following:

formatDateTime(triggerBody()?['Created'],'yyyy-MM-ddTHH:mm')

right input box set to following:

formatDateTime(triggerBody()?['Modified'],'yyyy-MM-ddTHH:mm')

middle compare operator box set to is equal to.

For second condition row, left input box set to the IsModified (Yes/No type columnDynamic content, right input box set to following:

true

middle compare operator box set to is equal to.

 

Then within the "Update Item" action, set the IsModified field to following:

No

When the user want to edit an existing record in your SP List, please ask him to set the IsModified field to Yes value within the PowerApps form.

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-xida-msft ,

 

Thank you for the detailed answer. I also used another workaround to avoid too much mail. 

 

But as you can see from my Flow, it only get data from Sharepoint List Item. Unfortunately there is no Update Item within my Flow. This flow itself will not update sharepoint list item. The problem can only be from PowerApps.

 

What I observed is that the item is saved four times times after I submit the PowerApps form, with 2 attachments.

1st time: All text contents saved

2nd time: 1st attachment saved

3rd time: Append-Only Comment field updated to blank

4th time: 2nd attachment saved

 

My guess is that something is wrong with attachments control. The uploading of attachment may write data to sharepoint list item gradually.

 

 

キャプチャ.JPG

Hi @victorwc ,

Yeah, based on the flow screenshot that you provided, I agree with your thought almost. I think this issue may be related to the uploading mechanism of the Attachments control in PowerApps.

 

Currently, I could not came up with a good solution to fix this issue. If you would like to get further help in this issue, please consider submit an assisted supported ticket through the following link:

https://powerapps.microsoft.com/en-us/support/pro

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-xida-msft 

 

Thank you for your promprt reply.

I will submit a support ticket later.

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (2,159)