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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Is a variable null whe...
Power Automate
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.

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,649 Most Valuable Professional on at

    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.

  • Peter A Clements Profile Picture
    25 on at

    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.

  • Verified answer
    Pstork1 Profile Picture
    69,649 Most Valuable Professional on at

    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

    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.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 298 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 159 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 150 Super User 2026 Season 2

Last 30 days Overall leaderboard