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 Apps
Answered

Formula help

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello Everyone ,

I am having sharepoint as datasource and wanna convert the chemical formula into subscript form like C02 should be seen as CO and downside 2 number whether it is another like H2O then 2 should go down side. WHat should I use to show in PowerApps.

 

Regards,

Sagar Shah

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

    @Anonymous 

    Inspired by this post I was able to build a workaround.

     

    In a SharePoint List I added a Single-line of Text column called 'Sub_Super_script'. Then,

    - in ID 1, for this new column, I added the text H<sub>2</sub>O

    - in ID 2, for this new column, I added the text CO<sub>2</sub>

     

    Then in PowerApps a created a Gallery, added a label for ID (ThisItem.ID) and a HTML Text label (ThisItem.Sub_Super_script) and this is how it displayed (Note: SP List on the left, and Gallery on the right)

    Sub_Super_script.jpg

     

    Not perfect but maybe a solution for you?

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Could you please share a bit more about the data structure of your SP List?

    Do you want to convert the chemical formula from your SP List Column into subscript form?

     

    I have made a test on my side, I think the Html Text control could achieve your needs. I assume that you want to list your SP List in a Gallery and you connect the Gallery to your SP List already, please add a HTML Text control inside your Gallery to display the chemical info. Set the HtmlText property of the HTML Text control to following:

     

    Subtitute(
     ThisItem.ChemicalColumn,
     First(MatchAll(ThisItem.ChemicalColumn, "(?<IndexNumber>\d+)")).FullMatch,
     "<sub>" & First(MatchAll(ThisItem.ChemicalColumn, "(?<IndexNumber>\d+)")).FullMatch & "</sub>"
    )

     

     

    17.JPG

     

    Please consider take a try with above solution, check if the issue is solved.

     

    Best regards,

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!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 84

#2
WarrenBelz Profile Picture

WarrenBelz 79 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 40 Super User 2026 Season 1

Last 30 days Overall leaderboard