Hi all. I have a bit of trouble with updating a string in SharePoint list items if the field is blank. I have tried to do a combination af Coalese and Replace, but it fails for me everytime. All I want is to avoid the "null errors" whenthe flow runs. The flow is at this time pretty simple:
A select component to pick the columns I need to make changes to:
A for each control, where I want to make the magic:
I have tried several things, for example:
Coalese(item()?['Column3'],'',replace(item()?['Column3'],'Old text','New text'))
if(coalesce(item()?['Column3'],'',replace(item()?['Column3'],'Old text','New text')))
Can anyone guide me in a correct direction, so I can make the changes to the list items without getting the "null error" when the field is blank. All I want is that if the field is not blank, then I need to replace a string, but I keep running into these "Null errors".
Thanks in advance
Solved! Go to Solution.
Try the below expression
You can use the coalesce function to provide default values when a value is null. So in your case if the value is null then it will replace with 'New Text'.
Hi @abm and thx for quick reply. All I want is to avoid the blank fields, so if a field is blank, the flow should just ignore it, and continue til a field that has data. I cannot get your solution to do this 😐
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Read the latest about new experiences and capabilities in the Power Automate product blog.
At the monthly call, connect with other leaders and find out how community makes your experience even better.
If you are a small business ISV/Reseller, share your thoughts with our research team.