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 / Insert value for HTML ...
Power Apps
Answered

Insert value for HTML Text

(0) ShareShare
ReportReport
Posted on by 372

Hi Everyone!

I have HTML text for table format, I use this formula for get items for my table:

<tbody>
"
&
Concat(Gallery2.AllItems, "<tr><td>" & Assembly & "</td><td>" & 'Joint No' & "</td><td>" & 'Welding Process' & "</td><td>" & WPS& "</td><td>" & 'Welder ID' & "</td><td>" & Flux & "</td><td>" & Rod & "</td><td>" & 'Inspection Date' & "</td><td>" & Text(Value('Type of Defect'.Value)) & "</td><td>" & 'Weld Size Actual' & "</td><td>" & 'Weld Size Req' & "</td><td>" & 'Inspection Method' & "</td><td>" & DetailInsp & "</td></tr>")
&
"
</tbody>

But my column 'Type of Defect' are choice type. So it error when I just write like that. The error message is:

firda59_0-1686101132600.png

 

How to fix it? Thank you in advance.

Categories:
  • WarrenBelz Profile Picture
    156,545 Most Valuable Professional on at

    Hi @firda59 ,

    You just need

    'Type of Defect'.Value

     

    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

  • firda59 Profile Picture
    372 on at

    Hello, @WarrenBelz 

     

    after I use that formula, I got this message:

    Invalid argument type. Expecting one of the following: Text, Number, Decimal, Date, Time, DateTimeNoTimeZone, DateTime, Boolean, OptionSetValue, ViewValue, UntypedObject.

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

    @firda59,

    Can you please suply the full HTML text as that is the correct reference providing this is a single choice column.

  • firda59 Profile Picture
    372 on at

    Hi @WarrenBelz 

     

    <table>
    <col width=15%>
    <col width=8%>
    <col width=7%>
    <col width=7%>
    <col width=7%>
    <col width=9%>
    <col width=9%>
    <col width=9%>
    <col width=8%>
    <col width=7%>
    <col width=7%>
    <col width=7%>
    <col width=9%>
    <thead>
    <tr>
    <th style=text-align:center; rowspan=2; colspan=1;>
    ASSEMBLY
    </th>
    <th style=text-align:center; rowspan=2; colspan=1;>
    WELD NO.
    </th>
    <th style=text-align:center; rowspan=2; colspan=1;>
    WELDING PROCESS
    </th>
    <th style=text-align:center; rowspan=2; colspan=1;>
    WPS
    </th>
    <th style=text-align:center; rowspan=2; colspan=1;>
    WELDER ID
    </th>
    <th style=text-align:center; rowspan=1; colspan=2;>
    CONSUMABLE
    SYMBOL/BATCH NO.
    </th>
    <th style=text-align:center; rowspan=2; colspan=1;>
    DATE
    </th>
    <th style=text-align:center; rowspan=1; colspan=3;>
    INSPECTION RESULT
    </th>
    <th style=text-align:center; rowspan=2; colspan=1;>
    NDE
    </th>
    <th style=text-align:center; rowspan=2; colspan=1;>
    REMARK
    </th>
    </tr>
    <tr>
    <th style=text-align:center;> FLUX / K-71TLF</th>
    <th style=text-align:center;> ROD</th>
    <th style=text-align:center;> DEFECT</th>
    <th style=text-align:center;> WELD SIZE</th>
    <th style=text-align:center;> WELD REQ.</th>
    </tr>
    </thead>
    <tbody>
    "
    &
    Concat(Gallery2.AllItems, "<tr><td>" & Assembly & "</td><td>" & 'Joint No' & "</td><td>" & 'Welding Process' & "</td><td>" & WPS& "</td><td>" & 'Welder ID' & "</td><td>" & Flux & "</td><td>" & Rod & "</td><td>" & 'Inspection Date' & "</td><td>" & 'Type of Defect'.Value & "</td><td>" & 'Weld Size Actual' & "</td><td>" & 'Weld Size Req' & "</td><td>" & 'Inspection Method' & "</td><td>" & DetailInsp & "</td></tr>")
    &
    "
    </tbody>
    </table>

     

    here the HTML text

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

    @firda59 ,

    Based on what you have posted, if that is a single choice field, the code is correct. You can also use the control name it is contained in the gallery.

  • firda59 Profile Picture
    372 on at

    @WarrenBelz ,

    but I still got this message,

     

    Invalid argument type. Expecting one of the following: Text, Number, Decimal, Date, Time, DateTimeNoTimeZone, DateTime, Boolean, OptionSetValue, ViewValue, UntypedObject.

     

    Do you know why this happen?

  • Ethan_009 Profile Picture
    4,840 Moderator on at

    Hi @firda59 ,

     

    Can you show us the data of your collection with respect to the value stored in that column?

    I'm not sure why you are getting this since what @WarrenBelz  is correct but still you are facing the error then let's see what's stored in your collection.

     

    Also, as per your error, 

    Try to enable this and check again if it solved your problem

    Ethan_R_0-1686120111678.png

     

     

    Hope this helps

  • firda59 Profile Picture
    372 on at

    @Ethan_R 

     

    Ok, this is my data collection:

    firda59_0-1686120863239.pngfirda59_1-1686120894240.png

     

     

  • Ethan_009 Profile Picture
    4,840 Moderator on at

    Hi @firda59 ,

     

    This is multi-select optionset. 

    Can you send me screenshot of the collection containing data within the App itself?

     

    If it is stored in table format then you can use

    Concat('Type of Defect', "; ")
    
    //OR
    
    Concat('Type of Defect'.Value, "; ")

     

    But if not then will have to observe the data stored in collection.

     

  • firda59 Profile Picture
    372 on at

    Hello @Ethan_R 

     

    the formula did not error again, but the value not appear.

     

    This is my database:

    firda59_0-1686122574718.png

    and this is the result from that HTML:

    firda59_1-1686122645855.png

     

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 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard