Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Is a variable null when no value supplied

(0) ShareShare
ReportReport
Posted on by 25

I have a variable which has been initialised with the value of an ID field (a D365 guid) which points from one entity to another. On occasion the field won't be populated. Question: in these situations, am I correct in assuming that the variable would be NULL?

Peter.

  • Peter A Clements Profile Picture
    25 on at
    Re: Is a variable null when no value supplied

    Thanks very much - I think it's working now. Interesting how core knowledge around the difference between NULL and EMPTY is so important. I come from a non developer background and I guess it shows!

    Peter.

  • Verified answer
    Pstork1 Profile Picture
    65,957 Most Valuable Professional on at
    Re: Is a variable null when no value supplied

    For a string I normally test by checking the length of the string.  If its blank the length will be 0.  For a GUID you could go one step further and test whether you have a valid GUID by comparing the length to what the length of a GUID should be.  This would depend on the format you are using.

  • Peter A Clements Profile Picture
    25 on at
    Re: Is a variable null when no value supplied

    Hi, I am using a string variable. So, it sounds like my test for NOT NULL explains why it isn't working. I don't use the GUID for anything - I'm just checking to see if the link exists. What would be the right test to check whether there is something in the variable.

    Appreciate all your help by the way

     

    Peter.

  • Pstork1 Profile Picture
    65,957 Most Valuable Professional on at
    Re: Is a variable null when no value supplied

    What variable type are you using to hold the guid?  There isn't a variable type specific to quid, but it could be object or string.  For string it would be empty, not null.  But for object it would be null.  String is the better choice since that can be converted to an actual GUID.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,618 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,957 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow