cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Pkrrs
Frequent Visitor

How do i fix null values if i know the list is not empty ?

 

Hey i was working on a flow which sends emails to people who have several tasks to do.. so I join the tasks together and try to find the unique email IDs. there are 2 records in the sharepoint list and both have emails. but i get this issue and i dont know how to solve it.

 

BadRequest. The value cannot be null. The action type 'AppendToArrayVariable' only supports values of types 'Float, Integer, String, Boolean, Object'.

 

Pkrrs_0-1653640799142.png

 

This is my flow and i do check for null. But it still returns as null.

 

Pkrrs_1-1653641074644.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
eliotcole
Super User
Super User

Have you also tried checking whether it is not equal to a blank entry in that condition?

 

Sometimes a blank entry in a SharePoint list doesn't report as null, but as a string value that's just empty. (I know, it's weird)

 

An alternative is to use to forget the condition and to use this in your Append to array variable action wherever you need the value that's proving troublesome:

if(
    or(
        equals(
            VALUE_REF,
            null
        ),
        equals(
            VALUE_REF,
            ''
        )
    ),
    'none',
    VALUE_REF
)

That does the same thing as your condition, but fits it all into one little bit of logic. If the value is "empty", or null, then it will write in the word 'none' into the value, if it has something there, it will place the value there.

 

If you edit your question with more of your flow, though (obfuscate anything you want private), there may be either a more graceful, or an easier way of handling it. Like using a Select or Filter action to potentially avoid using the Apply to each. 🙂

 

However that expression should do the trick.

View solution in original post

4 REPLIES 4
eliotcole
Super User
Super User

Have you also tried checking whether it is not equal to a blank entry in that condition?

 

Sometimes a blank entry in a SharePoint list doesn't report as null, but as a string value that's just empty. (I know, it's weird)

 

An alternative is to use to forget the condition and to use this in your Append to array variable action wherever you need the value that's proving troublesome:

if(
    or(
        equals(
            VALUE_REF,
            null
        ),
        equals(
            VALUE_REF,
            ''
        )
    ),
    'none',
    VALUE_REF
)

That does the same thing as your condition, but fits it all into one little bit of logic. If the value is "empty", or null, then it will write in the word 'none' into the value, if it has something there, it will place the value there.

 

If you edit your question with more of your flow, though (obfuscate anything you want private), there may be either a more graceful, or an easier way of handling it. Like using a Select or Filter action to potentially avoid using the Apply to each. 🙂

 

However that expression should do the trick.

Pkrrs
Frequent Visitor

Hey it worked thanks for the help. Sorry for the late reply 🙂

Pkrrs
Frequent Visitor

Where do we exactly put this..

Pkrrs_0-1653887690357.png

 

Because I tried to use this a formula but it didn't work and reported as invalid and i tried to use it in the value part and i get returned the right email id's along with the conditions...

 

if(or(equals(VALUE,null),equals(VALUE,'')),'none',VALUE). please help.. 

No probs, mate. Glad you got there! 👍

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,688)