web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Replace/ Remove Blank ...
Power Automate
Unanswered

Replace/ Remove Blank value in Body/ Item - Transform Input from Array to integer to Single Number

(0) ShareShare
ReportReport
Posted on by 6

Hi everyone.

 

I'm currently developing a Flow in which the numbers are extracted from SharePoint list (from Get Item).

However, there is a blank (aka Null) in the value section (after Select)

 

My objective is calculating the sum of numbers (via XPath method/ addition of integers in the body)

 

WithBlank

straight1_0-1667448603211.png

 

NoBlank

straight1_1-1667448623843.png

 

Add

straight1_2-1667448651024.png

 

Flow

straight1_3-1667448694999.png

 

What are the suggested actions and expressions, from WithBlank to NoBlank to Add?

 

I realise the input collected earlier steps are in array/ string type, so maybe need to change it to integer in WithBlank step

 

If possible, how about replace the "" (blank)/ null in WithBlank to 0? What is the action/ expression?

 

Most of the use cases I found online are on Power BI/ Power App, so your assistance is truly appreciated.

 

Thank you

Categories:
I have the same question (0)
  • grantjenkins Profile Picture
    11,063 Moderator on at

    This should be what you are after. Note I've stated with the list of numbers as strings.

     

    grantjenkins_0-1667449938576.png

     

    Compose is your array of numbers (strings).

    grantjenkins_1-1667449982682.png

     

    Filter array can be used to remove empty strings as so. Note the expression is just item()

    grantjenkins_2-1667450017770.png

     

    JSON converts the output to XML.

    grantjenkins_3-1667450054709.png

     

    And finally, your xpath to sum up the numbers.

    xpath(xml(outputs('JSON')), 'sum(/root/Numbers)')

    grantjenkins_4-1667450078327.png

     

    Result is:

    grantjenkins_5-1667450163640.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard