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 / Flow fails when field ...
Power Automate
Unanswered

Flow fails when field not populated

(0) ShareShare
ReportReport
Posted on by

Is there a workaround for allowing a flow to run when it's calling a field that has no data populated? I have a sharepoint list with an optional field for a phone number. I need it to send an email and contain the phone number if it's included but since it's an optional field it's not required and not always populated. I still need the email to be sent though. Short of populating the field with a default value and sending that, is there a way to allow the flow to complete without having populated data for optional fields?

Thanks!

Categories:
I have the same question (0)
  • efialtes Profile Picture
    350 on at

    @Anonymous

    According to https://msdn.microsoft.com/en-us/library/azure/mt643789.aspx you can use this expression in a condition block to handle null trigger outputs

    @coalesce(trigger().outputs?.body?.property1, 'my default value')

     

    I implemented a test flow with a New Sharepoint item trigger, the following condition

    @equals(coalesce(trigger().outputs?.body?.propertyX, 'NULL'),  'NULL')

    On the YES branch I included a "Send email" action block for confirmation purposes, leaving the NO branch empty. 

     

    In the Sharepoint list definition I included an optional column (propertyX), then I added an iten without filling the optional column.

    The flow succeded and I received the confirmation email. But when opening again the flow for editing purposes the following error is displayed:

    "unexpected character '?', mode 3"

    and no flow block is displayed anymore.

     

    Assuming this is the way to proceed, It will be more user frienly if the condition block offers an option called "not present" and internally converts it to the above expression

     

  • efialtes Profile Picture
    350 on at

    @Anonymous

    I found another thread in this community where @Samuel explains the use of coalesce much much better than my previous post.

     

    https://powerusers.microsoft.com/t5/Flow-Forum/Is-there-a-way-to-process-null-values-from-CRM-to-SharePoint/m-p/1075/highlight/true#M25

     

    As Samuel suggests, a simpler solution than the one I proposed in my previous post can be the following: invoke coalesce in the email body.

     

    @{coalesce(triggerBody()['telephoneproperty'], 'no telephone nr available')}

     

    According to the documentation, coalesce returns the first non-null object in the arguments passed in. Note: an empty string is not null. For example, if parameters 1 and 2 is not defined, this will return fallback: coalesce(parameters('parameter1'), parameters('parameter2') ,'fallback')

     

     

    Hope this helps

     

     

     

     

     

  • Mack Profile Picture
    31 on at

    I have over 70 variables that could possibly be null. Do I have to write a coalesce expression for each single variable?

  • dnndev Profile Picture
    9 on at

    Did you find an anwert to your question and implemented coalesce for all 70 variables?. I am on a same boat and doing so would be tedious and error prone

  • Lexnnn Profile Picture
    94 on at

    Maybe an idea:

    Having empty values in Select action caused issues so needed a way to use default value in case of empty. This solution worked for me!

    flow empty select.JPG

     

    if(empty(item()?['Address']),'blank',item()?['Address'])

  • GabrielStJohn Profile Picture
    on at

    Hello, @Anonymous!

     

    Thank you for posting on the Flow Community Forum! Have you had an opportunity to apply @Lexnnn‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!


    Thank you for being an active member of the Flow Community!

     

    -Gabriel
    Flow Community Manager

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

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard