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 / Building HTML (string)...
Power Apps
Answered

Building HTML (string) from ForAll

(1) ShareShare
ReportReport
Posted on by 402

I need to loop through a ForAll and compose some HTML that is going to be used in an HTML control.  I have the following:

 

UpdateContext({FinalizedRecords: "<h4><strong><u>BOOKINGS</u></strong></h4>"});
ForAll(
 JBRecordsToFinalize,
 Collect(
 JBRecords,
 "<p><strong>" & LookUp(
 ConsumerRecords,
 ThisRecord.ClientID = 'Client ID',
 Name
 ) & " " & ThisRecord.ClientID & "</strong></p>"
 )
);

If I want to concatenate FinalizedRecords (the header) and JBRecords, I get an error about expecting Text.  Is JBRecords not text or am I missing something?  Thanks for the help

Categories:
I have the same question (0)
  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    you should use concat, unless you need JBRecords to be a collection you can use later, forall is slow if your just making an html list

     

    UpdateContext({FinalizedRecords: Concatenate("<h4><strong><u>BOOKINGS</u></strong></h4>",
    Concat(JBRecordsToFinalize,
    "<p><strong>" & Lookup(ConsumerRecords,ClientID = 'Client ID',Name) &
    " " & ClientID & "</strong></p>"))

     

    The code above should produce an html string that can be used to display all records in JBRecordsToFinalize without creating an extra collection and running a forall. Let me know if that helps 

  • iskguy Profile Picture
    402 on at

    Thanks for this information!

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard