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 / Is a variable null whe...
Power Automate
Unanswered

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
    68,697 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
    68,697 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

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