2 Ways to Update a SharePoint List Yes/No Field in Power Automate

Updating a SharePoint list Yes/No field in Power Automate can be a valuable tool for managing your data and automating certain processes. This article will guide you through the necessary steps to effectively manage these fields and streamline your workflows.

When working with Power Automate, it’s important to use the correct format for updating a Yes/No SharePoint column. Contrary to popular belief, you should use numeric values, specifically 1 for Yes and 0 for No. This ensures the proper functioning of your flow and prevents potential issues.

While interacting with SharePoint list Yes/No fields in Power Automate, you may need to set or update these fields using a Flow variable. To achieve this, you can create a string variable and set its value to either “true” for Yes or “false” for No. By following these guidelines, you can simplify your Power Automate processes and make the most of your SharePoint integration.

Yes/No Field in SharePoint Lists

Yes/No fields in SharePoint lists are a type of boolean field. They can take on the value of true or false.

They are visually represented in your list by a checkmark for Yes or no checkmark for No. Internally, SharePoint represents these values as true for Yes and false for No.

This field type is a great option for tracking binary data such as an active status, or other simple yes/no choices.

Use the Get Item Action

Before updating a SharePoint list with Power Automate, you need to first retrieve the item you want to update using the Get item action.

This is because the Update item action requires the Title field, so if you don’t want to change this value you will need to set it based on the current value.

The Title field in a SharePoint list is another system field that is used to provide a name or title for each item in the list, and it is mandatory for SharePoint lists to have a Title field.

It is a single line of text column that comes preconfigured with every new list you create in SharePoint.

In Power Automate, the SharePoint actions that write back to a list require this field to be filled in.

  1. Add the Get item action from the SharePoint connector to your flow.
  2. Select the Site Address where your list is contained.
  3. Select the List Name from the dropdown list.
  4. Add the Id for the SharePoint list item in which you want to update the Yes/No field. This is an integer value greater than or equal to 1 and can be referenced as a value or dynamic content.

The ID field in a SharePoint list is a system generated field that automatically assigns a unique identifier to each item in the list. When a new item is added to the list, the ID number increments by one.

This unique identifier is needed to get any item from your list.

Update the Yes/No Field with the Update Item Action

Once you have retrieved the item, the next step is to use the Update item action. This action will allow you to change the value of the Yes/No field in your SharePoint list.

Follow these steps to update the Yes/No field.

  1. Add the Update item action to your flow after the Get item action.
  2. Choose the Site Address where your list is stored.
  3. Choose the List Name from the dropdown.
  4. Add the Id for the list item you want to update. This should be the same value or dynamic content previously used in the Get item action.
  5. Add the Title dynamic content from the Get item action to the Title field in the Update item action. This ensures the Title value doesn’t change when updating your Yes/No field.
  6. Select either the Yes or No value from the dropdown list in your Yes/No field.

This will update your Yes/No field as required.

Update the Yes/No Field with a Custom Value Expression

There might be a situation where selecting either Yes or No from the dropdown list in Update item action won’t get your desired result.

For example, you might need to update the value based on some calculation or set the value to the opposite of the current value.

In these situations, you will need to use a custom value. The trick is this needs to be either a true or false value, if you try and use a Yes or No text value, the action will fail.

if(outputs('Get_item')?['body/Active'],false,true)

You can use the above expression to set the Yes/No field to the opposite value based on the previous value from the Get item action.

This expression returns false when the Yes/No field named Active is Yes, and returns true when it is No.

Here’s how to use the custom value.

  1. Select the Enter custom value in your Yes/No field of the Update item action.

This allows you to enter a custom value in the field. But if you try to enter a text value, a warning message will appear telling you to enter a valid boolean. This means the field will only accept a true or false value.

The warning won’t appear when you add dynamic content or an expression that evaluates to a text value. You need to be sure these also evaluate to boolean values,

  1. Add your expression, dynamic content, or boolean value to your Yes/No field custom value.

This will update the Yes/No field to your custom boolean value.

Conclusions

This article has shown you how to update a SharePoint list’s Yes/No field with a simple choice or using a custom value.

The trick to updating your list is you need to use the Get Item action to obtain the previous Title value from your item, then you can use the Update Item action without overwriting the Title.

After, updating the Yes/No field is a simple matter of selecting Yes or No from the dropdown list in the Update item action.

You can also use a custom value to update the Yes/No field, but these need to be a true or false value.

Have you had trouble updating your Yes/No fields in SharePoint lists? Let me know in the comments!

About the Author

John MacDougall

John MacDougall

John is a Microsoft MVP and freelance consultant and trainer specializing in Excel, Power BI, Power Automate, Power Apps and SharePoint. You can find other interesting articles from John on his blog or YouTube channel.

Related Articles

Comments

0 Comments

Get the Latest Tech Tips

Write For Us

Are you a tech enthusiast with a talent for writing great content? Come write for us!

Follow Us

Follow us on social media to stay up to date with the latest in tech!