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 / HTML to display only d...
Power Apps
Answered

HTML to display only data cards that have data

(0) ShareShare
ReportReport
Posted on by 151

Hello,

 

OPEN TO ANY SUGGESTIONS 

 

I am currently trying to come up with some method for my HTML text to display only the datacards that have data in them and not any other data cards. The reason behind this is I am wanting a PDF generated from the HTML and I am trying to reduce pages. 

 

The determination for which data card will have data is based off a choice list. Once the choice is selected, the datacard associated with that choice has to be filled out. If a choice and its associated data card is not selected, I do not want it on the PDF. I have around 10 choices on my list and it can be any configuration of only 1 choice selected to 10 choices. I am just trying to avoid having 9 PDF pages on empty data if I only selected 1 choice. 

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    154,793 Most Valuable Professional on at

    Hi @Jakegolden ,'

    You would have a lot of the below in your code

    If(
     !IsBlank(ControlName.Output),
     "HTML Label " & ControlName.Output & "<br>"
    )

     

    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

  • Jakegolden Profile Picture
    151 on at

    Hey @WarrenBelz 

     

    I seem to be having some issues with implementing the above code.

     

    I am receiving errors of

     

    Invalid number of arguments: received 2, expected 1

    Invalid number of arguments: received 1, expected 2 or more. 

  • WarrenBelz Profile Picture
    154,793 Most Valuable Professional on at

    @Jakegolden ,

    Please look at amended post.

  • Jakegolden Profile Picture
    151 on at

    Hey @WarrenBelz 

     

    I have another question similar to this answer you provided.

    This logic worked perfectly for me based on displaying a value when a datacard has data. How would I use this similar code on a unique selected value. 

     

    For example I want to only capture the ones that have "No" selected in the datacard. 

  • Jakegolden Profile Picture
    151 on at

    Actually, I am sorry to bother. It was a simple change of writing it as such -

     

    If(
    DataCardValue.Selected.Value = "No",
    DataCardKey.Text &"<br>")

     

    Thank you 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 519 Most Valuable Professional

#2
11manish Profile Picture

11manish 489

#3
Haque Profile Picture

Haque 327

Last 30 days Overall leaderboard