Skip to content

Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Problems
  • Triggers
  • Application specific solutions
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Resources
Menu

Update SharePoint column only if there’s a value using Power Automate

Posted on March 20, 2022March 20, 2022 by Tom

“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'))
Power Automate SharePoint update only if value

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.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Now available:

The Ultimate Power Automate expressions cheat sheet
Equip yourself with the tool to translate your thoughts into Power Automate expressions!

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Hello and welcome!

My name is Tom and I'm a business process automation consultant and Microsoft MVP living in the Czech Republic. I’ve been working with Microsoft technologies for almost 10 years, currently using mainly Power Automate, SharePoint, Teams, and the other M365 tools.

I believe that everyone can automate part of their work with the Power Automate platform. You can achieve a lot by "clicking" the flows in the designer, but you can achieve much more if you add a bit of coding knowledge. And that's what this blog is about.

To make the step from no-code Power Automate flows to low-code flows: using basic coding knowledge to build more complex yet more efficient flows to automate more of your daily tasks.

  • Format results of date calculation in SharePoint columnJune 29, 2022
  • Why is your Power Automate flow creating duplicatesJune 26, 2022
  • How to create a unique identifier in your Power Automate flowJune 22, 2022
  • How to assign custom SharePoint permission level with Power AutomateJune 19, 2022
  • Remove permissions from a specific SharePoint user with Power AutomateJune 15, 2022

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

© 2022 Let's POWER Automate | Powered by Superbs Personal Blog theme