cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ericonline
Community Champion
Community Champion

Conditional Format of OUTPUT

I have an interesting issue I'm hoping you can help with. 

 

What I currently have (works fine) : 

  • PowerApp connected to a Sharepiont Custom List
  • Microsoft Flow that grabs each new record from SP list, creates a .doc, converts .doc to .pdf
  • Flow uploads .pdf to a SP Document Library

I need to conditionally format some of the items in the .pdf in red based on what is entered in the PowerApp

 

Example: 

  • If user marks a question in the PowerApp with "Exceptions Taken", I need the final .pdf to turn that item red to attract the eyes of the person reading. 

 

Anyone know of a way to accomplish this somewhere in the PowerApp, on Sharepoint, or in the Flow? I'm thinking of a way to grab the .doc and apply conditional formatting there, but I dont' know how to go about it. 

 

Thank you

10 REPLIES 10
v-micsh-msft
Community Support
Community Support

So here what you are trying to achieve is to modify the .PDF content wihtin PowerAppps or Microsoft Flow?

Based on what I know, currently there is no way to achieve that.

 

You may need to submit it as an idea through the following page:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

No. I'm trying to conditionally format text somewhere in PowerApps, Sharepoint or Flow BEFORE the document becomes a PDF. 

 

 

Here is the workflow in more detail if it helps: 

 

  1. User fills out a form in PowerApps and submits it
  2. The completed form becomes a record in a Sharepoint list
  3. A Flow is set off which takes the content from the new Sharepoint record and
    1. Converts it to .doc format
    2. Runs it through a Word template I created
    3. Saves the new .doc to a Sharepoint Document Library
    4. Sends the .doc to OneDrive for Business and converts it to .pdf
    5. Saves the new .pdf to the same Sharepoint Document Library

What I need: 

 

  • If a user marks one of the options in the form with "Exceptions Taken" (aka "bad"), I want to somehow highlight it in red or otherwise bring attention to it when people view the final .pdf. 
  • This conditional formatting can occur anywhere in the above workflow, I just need help establishing WHERE in the workflow to make that happen. 
Anonymous
Not applicable

I guess you could tackle at a number of points, but It's dependant on what format you're storing your data.

 

Personally, when initially processing the form, I'd do my checks there and wrap any positively met conditions in a basic <font color="red"> my text here </font> tag.  

 

Write that into the SP list and see how that works when you're converting into word and then PDF.

Thank you for the response @Anonymous. Does this method then make the Sharepoint column a "calculated" column? If so, this causes issues with PowerApps. 

Anonymous
Not applicable

Ah yes, just had a play and I see what you mean.  Annoying 😞

 

Ok, so how about this.  For each condition that you're checking, add a new yes/no column in your SP list and on your form set these as visible:false  - and for the text value do your conditional checking there e.g. If(ThisItem.Title="Issue",1,0)

 

You'll then save this data too, recording that it's an issue (which can only be a good thing?)

 

Then when reading that data back and coming to write it, check the y/n value associated with the question and at that point use concatenate to wrap it in the font tag (assuming that the simple html tag will work!) before you write the data.

 

Good luck 🙂

 

 

Whew! That could work. There are ~40 form fields in this app. Not sure I want to double them up. Thanks for the lead though, I may be able to find a way to Patch things in. 

 

Please let me know if you think of another way. 

 

Take care

Anonymous
Not applicable

Interestingly, the calculated field I had in SP is actuually coming through, just not with the fieldname I expected...maybe that's a possible for you then?

 

calc1.JPG

 

Maybe try that?  

 

My calcuated field in SP had this formula to check the condiion :  if([text]="bbb","<font color='red'>"&[text]&"</font>",[text])

cyarbrough
Helper III
Helper III

i feel like the easiest way to do this would be to generate the document in powerapps with an HTML text control and use if statements on the text color/fill html. example .HtmlText:

 

"<div align=center><table border=0 style=font-family:Arial, Helvetica, sans-serif;>"
&If(question1.Value="triggervalue","<font color=red>","<font color=black>")
&"Your text</font>"
&"</table></div>"

i'm sure that html isn't perfect, but hopefully it gets the point across. then you can pass the control's HtmlText value directly to flow from powerapps to create and convert the .doc.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (71,073)