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 Apps / Filtering empty text i...
Power Apps
Answered

Filtering empty text inputs

(0) ShareShare
ReportReport
Posted on by 41

Hello all, 

 

I would like to ask you for help with following issue:

 

I have in my canvas app 5 text inputs in the row, which are patched by submit button to the dataverse table:

 

Peter_2020_0-1666336824776.png

And on the another screen I need to define for the label in the gallery following formula:

 - show me text input 5 in case that there is some record, if not show me text input 4 if is not empty,

 - if text input 4 is empty show me text input 3, 

 - if text input 3 is empty show me text input 2, 

 - if text input 2 is empty show me text input 1.

 

I have tried this formula but it works just to the 3rd text input...

 

If(IsBlank(Text input5');text input4';text input5') &
If(IsBlank(Text input 4');Text input3';Text input4') &
If(IsBlank(Text input3');Text input2';Text input3') &
If(IsBlank(Text input2');Text input1';Text input2)

 

Thank you very much. 

P.

 

 

Categories:
I have the same question (0)
  • Verified answer
    zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    Use Coalesce Function. It will get you first none blank value. It will be just one line of code.

     

    https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-isblank-isempty

  • WarrenBelz Profile Picture
    153,075 Most Valuable Professional on at

    Hi @Peter_2020 ,

    You just need to cascade it down

    If(
     Len('Text input5'.Text) > 0;
     'text input5'.Text;
     Len('Text input4'.Text) > 0;
     'text input4'.Text;
     Len('Text input3'.Text) > 0;
     'text input3'.Text;
     Len('Text input2'.Text) > 0;
     'text input2'.Text;
     'text input1'.Text
    )

     

    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.

    Visit my blog Practical Power Apps

  • Peter_2020 Profile Picture
    41 on at

    @zmansuri how simple when you know what to do.... thanky you so much for your help

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    Glad it worked out

  • WarrenBelz Profile Picture
    153,075 Most Valuable Professional on at

    @Peter_2020 ,

    I almost headed down the Coalesce line, but tried to keep it simple modifying your code - glad you grasped the concept as many struggle with it.

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard