“If the optional SharePoint fields are left blank the update via Power Automate in the second list changes the field to a blank value as opposed to leaving it as the original value.”
The usage of the SharePoint ‘Update item’ action can be a bit confusing. It’ll show all the fields you can update, but that doesn’t mean that all of them must be updated. If you want to keep the original value, you can just keep the field empty (unless it’s a mandatory field).
But it’s different if you use dynamic content as the field value. Once you use dynamic content, or an expression, it won’t keep the original value. Even if the dynamic content is empty, it’ll update the field – to an empty value.
How do you then use dynamic content while keeping the original value if it’s empty?
You’ll need the original value
Since it’ll always do an update, you’ll always need some value, either the original one or the new one. If you use an item based trigger (e.g. item is created/updated), you can get the original value as an output of the trigger. For other triggers get the value using ‘Get item’ action before the update.
Let’s use the second approach in this example, get the values with the ‘Get item’ action.
All the values will be available among the dynamic contents.
Keep the original value if there isn’t a new one
Once you have the original value, you can build an expression for the update. If the new value is empty, keep the original value, otherwise update it to the new one. It’ll be the same if(…) and empty(…) expressions as when updating a date/time column.
if(empty(<newValue>),<oldValue>,<newValue>)
Replacing the <…> placeholders it can look as below:
if(empty(outputs('Compose')),outputs('Get_item')?['body/Title'],outputs('Compose'))
Repeat the same expression with different values for all the fields.
Summary
To update SharePoint columns only if there’s a new value, Power Automate needs three things. It needs the previous value, the if(…) expression, and a check if the new value isn’t empty. Combine them together in a single expression and update the field only if there’s a new value.
Very helpfull, as all your articles!
I have a flow to extract items from sharepoint list (which were not extracted yet) and save in a CSV file in a daily basis. Then, update the “DateExtracted” (with current local time date) to not be extracted again in the next day.
In the update section I deal with choice columns (multiple and unique selection) and with Yes/No question. The challenge is to keep the same value I got in the “Get Items” section and update only the “DateExtracted”. The problem is that those columns, specially Yes/No, update to the default value of Sharepoint structured when I don’t specify the value. I just want to keep what was recorded (came from “get items”). In the SP list I have lots of columns like that, so I really have to specify those columns with each column from “get items” ?
Any help to make it better is appreciated.
Hello Tiago,
if you keep the fields in the ‘Update item’ action empty it shouldn’t update them, just remove the default value from the action.
Hi Tom
Update Item is the bane of my life. I have a list that captures application forms. Every time the form is processed by a flow, I want one of the last steps to be a simple update of the STATUS column in my list.
But if I use Update ITEM and ONLY populate the STATUS field, then lots of the other fields get blanked.
Over the 5 years of running my system, the criteria Flow uses to decide which fields to blank seems to change. At one point it seemed to only affect columns with default values. So then I updated the flows to dynamically read the existing value and write that into the field on Update Item. But then, after a while, other fields started to blank out. In the end I had to just dynamically repopulate EVERY field (about 45 fields!)
I tried to reduce the labour of this by writing a subflow clalled “update status” but
– you can only call subdlows if you put your flows in a “solution”
– having refactored the whole application into working subflows in a “solution” I moved into test and users can’t run flows in solutions unless you give thenm full access to the table! so I had to revert
I have heard people talk about how this might only affect mandatory and defaulted columns but that doesn’t seem to explain my issues. Indeed, I am trying to write a POC for a better “single field update and I can’t get the issue to replicate!
I created this test list
Column (click to edit) Type Required
Title Single line of text
textONE Single line of text
numONE Number
choiceONE Choice
CHANGME Single line of text
Modified Date and Time
Created Date and Time
Created By Person or Group
Modified By Person or Group
and a Flow to update the column “changeme” and no matter whaty combinations I do of mandation and default values, I can’t make them blank!
aaaaaaghhhhh
Becaues one of my flows that does an update and does not specify all fields has just started blanking data!
Do you have any idea
1. How to force the error for test
2. How to avoid it
T
Hello Toby,
did you try to update the columns with an HTTP request? https://tomriha.com/update-single-sharepoint-column-in-power-automate-with-http-request/ That’s what I use when there’re only a few columns to update among a ton of mandatory ones.