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 / Substitute null in a t...
Power Apps
Unanswered

Substitute null in a table

(0) ShareShare
ReportReport
Posted on by 10

I am using a data collection and attempting to "substitute" some data table column values, to text, for example "1" equals "Approved" and "2" equals "Denied".  However, some entries do not have any status and should be considered equal to "Pending".  Meaning, while they show in my table in PowerApps, because they exist in the collection, their status "Approved/Denied" has not been set yet, so that data does not exist in my data collection for this column and I think would then be considered "null", "blank" or "empty" in the data collection.  However, I have tried the following strings and while they successfully replace the "1" and "2", the empty field will not update.  Perhaps I am missing the "substitute" function in this case?  

 

Substitute(Substitute(Substitute(ThisItem.Status, "1", "Approved"),"2", "Denied"), "", "Pending")

Substitute(Substitute(Substitute(ThisItem.Status, "1", "Approved"),"2", "Denied"), IsBlank(ThisItem.Status), "Pending")

Substitute(Substitute(Substitute(ThisItem.Status, "1", "Approved"),"2", "Denied"), IsEmpty(ThisItem.Status), "Pending")

Substitute(Substitute(Substitute(ThisItem.Status, "1", "Approved"),"2", "Denied"), Blank(), "Pending")

 

 I just need that "Blank" or missing value to return "Pending".  Thank you.

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,456 Most Valuable Professional on at

    Hi @intrepid505 ,

    You could try it this way

    With(
     {
     wSub: 
     Table(
     {Value: "1", Sub: "Approval"},
     {Value: "2", Sub: "Denied"},
     {Value: Blank(), Sub: "Pending"},
     {Value: "", Sub: "Pending"}
     )
     },
     LookUp(
     wSub,
     Value = ThisItem.Status
     ).Sub
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • intrepid505 Profile Picture
    10 on at

    This did not work, it said it could not compare data of two different types.  Thank you!

  • WarrenBelz Profile Picture
    156,456 Most Valuable Professional on at

    @intrepid505 ,

    It works perfectly here on a Text control

    WarrenBelz_0-1678672748040.png

    WarrenBelz_1-1678672773572.png

    WarrenBelz_2-1678672805621.png

    Assuming Status.Value is also text, it should work for you.

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

     

     

     

     

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard