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 Apps / Nullable Numeric Field...
Power Apps
Answered

Nullable Numeric Fields in PowerApps Collection

(0) ShareShare
ReportReport
Posted on by 254

Hi PowerApps Community,

I'm struggling with a specific issue in PowerApps and need some advice.

 

Challenge: I need to create a collection with a numeric field that initially holds a null value, and later update it with numeric data. However, initializing the field with Blank() causes a type mismatch when updating it with a number.

 

Tried Solutions:

  • Initializing with an empty string "", resulting in a type mismatch on updating.
  • Using Blank(), but it makes the field NullType and causes a type mismatch.

Ask:

  • How can I have a numeric field in a collection that can be null initially and then accept numeric values without type mismatch errors?
  • Are there any best practices for handling nullable numeric fields in collections?

Appreciate any guidance or solutions you can share!

 

Thanks,

 

Tim Jackson

Categories:
  • WiZey Profile Picture
    3,023 Moderator on at

    Hello @trjackson77 ,

     

    This question was already answered in this topic and is still relevant to this day:

    https://powerusers.microsoft.com/t5/Building-Power-Apps/How-to-put-a-number-in-blank-with-a-button/td-p/1341144

     

    tl;dr: It's not possible to insert a blank value in a numeric field. Power Apps does not allow it.

     

    Would it be fine for you to work with a zero value instead?

  • OdinDelToro Profile Picture
    407 on at

    Hello @trjackson77,

     

    Have you tried using value to make it recognize it as integer? For example: Value(Blank())

    Then when, you update the value, you can also use Value() to keep the numeric field in sync.

     

    Hope this helps clarify the doubt, let me know in case you're still facing an issue within it.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • trjackson77 Profile Picture
    254 on at

    @WiZey, thanks for the response and the link.  Unfortunately, 0 is not an option for this scenario.

  • trjackson77 Profile Picture
    254 on at

    @OdinDelToro, thanks for the solution, I really thought that would work.  Unfortunately (bizarrely), this inserts the value `0` into the collection.

     

    ClearCollect(colAllCustomers,AddColumns(tjCustomersWithRowIndex,"Duration",Value(Blank()))); Collect(colAllCustomers,AddColumns(Filter(tjCustomersWithRowIndex,RowIndex > Max(colAllCustomers,RowIndex)),"Duration",Value(Blank()))); Collect(colAllCustomers,AddColumns(Filter(tjCustomersWithRowIndex,RowIndex > Max(colAllCustomers,RowIndex)),"Duration",Value(Blank())))

     

    trjackson77_0-1705661651940.png

     

     

     

  • Verified answer
    trjackson77 Profile Picture
    254 on at

    Hi Everyone,

    I wanted to share an update on the challenge I was facing with handling nullable numeric fields in PowerApps collections. After some trial and error, I've found a couple of solutions that work well.

    Solutions:

    1. Dummy Record Method: Initially, create a collection with a dummy record that includes a numeric value in the problematic field. Once the collection is set up and functional, delete this dummy record. This method ensures the field is recognized as numeric from the start, allowing later entries to be either numeric or blank without causing type mismatches.

    2. Negative Value Placeholder: Another approach is to initialize the numeric field with a specific negative value (e.g., -1). When using the collection, filter out these placeholder values by only considering records where the numeric field is greater than or equal to 0. This effectively simulates a nullable numeric field.

    Both methods effectively bypass the type mismatch issue while maintaining the integrity of the data type in the collection.

     

    Acknowledgments: I want to thank everyone in the community for their suggestions and support. Your insights were invaluable and prompted me to explore these solutions. It's great to be part of such a knowledgeable and helpful community!

     

    Best regards,

     

    Tim Jackson

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard