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

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Function to set null

(0) ShareShare
ReportReport
Posted on by 4

Hello,

 

I'm trying to update data in my custom API using PATCH. I am unable to update a field to null. I have date, string and number fields that a nullable. Is there a built in power apps function that I can call the will put null in my API  Patch data for fields that i want changed to blank.

 

Thanks

-Ken 

I have the same question (0)
  • kklauder Profile Picture
    4 on at
    Re: Function to set null

    As an example in a save button

     

    I want to be able to call my custom API like the following for a date:

     

    WOSAPI.WOSV4PatchByWONUM("111", {COMPLETEDATE: If(Text(DatePicker3.SelectedDate, DateTimeFormat.UTC) = "", NULLFUNCTION, Text(DatePicker3.SelectedDate, DateTimeFormat.UTC))})

     

    This NULLFUNCTION would put null in my patch body

  • murali Profile Picture
    on at
    Re: Function to set null

    We currently don't have a function for that.

     

    I have added it as an Idea to Ideas board

     

    https://powerusers.microsoft.com/t5/PowerApps-Ideas/Function-to-produce-blank-value/idi-p/14353#M964

    Please upvote on this so the team can prioritize this.

     

    For now, I can think of a workaround using our current language syntax: unspecificed value in a If condition is treated as NULL.

     

    If you could change your expression to the following, it will work:

     

    WOSAPI.WOSV4PatchByWONUM("111", {COMPLETEDATE: If(Text(DatePicker3.SelectedDate, DateTimeFormat.UTC) <> "", Text(DatePicker3.SelectedDate, DateTimeFormat.UTC))})

     

    meaning if the value is empty string, no value i.e. NULL is specified.

     

    Hope this helps

     

    Thanks

    Murali

     

  • kklauder Profile Picture
    4 on at
    Re: Function to set null

    Hello,

     

    Looks like the work around you send me does not send null to my api. It only seems to ignore the field update.

     

    -Ken

  • Vicky_Song Profile Picture
    on at
    Re: Function to set null

    @kklauder, I think you're right. And as murali suggested, please submit one request in the Ideas forum. 

  • Meneghino Profile Picture
    6,949 on at
    Re: Function to set null

    Hi all, is there any update on this?  When will we be able to set fields in data sources to null?
    Thanks for the hard work.

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

Coming soon: forum hierarchy changes

In our never-ending quest to improve we are simplifying the forum hierarchy…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 651 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 385 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 230 Super User 2025 Season 2

Last 30 days Overall leaderboard