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 / If statement to ignore...
Power Automate
Answered

If statement to ignore 0 or null values and leave them as 0.

(0) ShareShare
ReportReport
Posted on by 70

Hi All,

I am working on building a flow which gets our data from a CSV file and reorganises it in the required format to upload to our other software, creating the new CSV file looks like this.

Watkins_1-1717678216829.png

 

Below is the multiplication function I have used and I believe that if the value is 0 then it won't 'mul' it, see the screenshot of error.

 

mul(split(item(), ';')?[5], 1000)

 

Watkins_0-1717674675565.png


I have tried a few different variations of if statements to try ignore the value if it is 0 and leave it as 0 but can't seem to get anything to work. Is there a way to do this or is there an error with the way I'm trying to do this? Thanks for the help in advance.

Regards,
Watkins

Categories:
I have the same question (0)
  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi Watkins,

     

    Pls try the below expression to handle null or empty values:

    if(empty(split(item(), ';')?[5]),0,mul(split(item(), ';')?[5], 1000))

     

     

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • Verified answer
    Chriddle Profile Picture
    8,441 Super User 2025 Season 2 on at

    @ManishSolanki wrote:

    Pls try the below expression to handle null or empty values:

    if(empty(split(item(), ';')?[5]),0,mul(split(item(), ';')?[5], 1000))

    Since split() returns an array of Strings, you have to convert this to a to number type before multiplication.

  • Watkins Profile Picture
    70 on at

    Hi Manish,

     

    As Chriddle said it does need to be converted to a number type first before doing the calculation otherwise it won't calculate and will just return the same value, fairly new to PowerAutomate so I'm not aware how to do this yet.

    Thanks,
    Watkins

  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Yes @Watkins 

     

    My friend @Chriddle  is always right 😀

     

    I have learnt a lot from him 🙏

     

    Today's lesson is never share expression without testing it.  Thanks @Chriddle 🙌

     

     

     

  • Watkins Profile Picture
    70 on at

    Hi Manish, 

    Thanks for the help just getting the expression has already helped a lot and is a step towards completing this, would you know of a way to convert this to a number type?

    Regards,
    Watkins

  • Verified answer
    ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @Watkins 

     

    Here is the expression:

    if(empty(split(item(), ';')?[5]),0,mul(int(split(item(), ';')?[5]), 1000))

    if input contains decimal number, use the below expression:

    if(empty(split(item(), ';')?[5]),0,mul(float(split(item(), ';')?[5]), 1000))

     

     

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • adedapo Profile Picture
    256 on at

    mul(coalesce(split(item(), ';')?[5],0), 1000)

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 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard