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
/Frank
Solved! Go to Solution.
Hi @venseben
Try the following
if(equals(length(item()?['Column3']), 0), 'New Text', 'Old Text')
Thanks
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogHi @venseben
Try the below expression
Coalese(item()?['Column3'],'New text'))
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'.
Thanks
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogHi @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 😐
/Frank
Hi @venseben
Try the following
if(equals(length(item()?['Column3']), 0), 'New Text', 'Old Text')
Thanks
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogLearn 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.
User | Count |
---|---|
26 | |
25 | |
23 | |
22 | |
18 |
User | Count |
---|---|
58 | |
42 | |
36 | |
30 | |
30 |