Skip to main content

Notifications

Power Automate - Building Flows
Answered

Conditional Text Formatting for Word Template

Posted on by 150

Is it possible to generate values in color and bold text when populating a Word template and converting the file to PDF? I have three conditions:

  1. If the value is 'BDL,' it should appear in plain text.
  2. If the value is 'LCM,' it should be green and bold.
  3. If the value is 'LOP,' it should be red and bold.

I’ve created a template with a table in a repeating section content control.

  • kiran_g Profile Picture
    kiran_g 150 on at
    Conditional Text Formatting for Word Template

    I can't share screenshots, but I can explain step-by-step. In my scenario, on the Word template, I have a column (Status) where I need the text color to change based on the status value:

    1. I created three different controls on that cell(status column): status1, status2 (green and bold), and status3 (red and bold), as per my requirement.
    2. In my flow, I set conditions as follows:
      • If the Status variable is 'BDL,' it appends to the array variable containing JSON format. In the JSON, I specify the control name where I need the text to appear, using status1 in this case. The same logic is applied for LCM and LOP values.
        
  • mmbr1606 Profile Picture
    mmbr1606 9,996 on at
    Conditional Text Formatting for Word Template
    hey
     
     
    can you post your solution here maybe with screenshots, so others can find the answer when they have similar issues?
     
     
    thanks in advance
  • Verified answer
    kiran_g Profile Picture
    kiran_g 150 on at
    Conditional Text Formatting for Word Template
    Thank You for the reply @mmbr1606
     
    I've placed three controls in the same cell, applied conditions in my flow, and appended them accordingly.
  • Suggested answer
    mmbr1606 Profile Picture
    mmbr1606 9,996 on at
    Conditional Text Formatting for Word Template
    hey
     
     
    the only thing that comes to my mind is to have a switch condition in your flow and chek for the above values.
     
    then you would need a templte for every possible choice. i have not seen that it is possible to do it dynamically only in word,
     
     
    if my answer helped please mark as verified,
     
     
    cheers

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,487

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,014

Leaderboard