cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User
Super User

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
Highlighted
Community Support
Community Support

Re: Conditional Format of OUTPUT

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.
Highlighted
Super User
Super User

Re: Conditional Format of OUTPUT

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

 

 

Highlighted
Super User
Super User

Re: Conditional Format of OUTPUT

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. 
Highlighted
Anonymous
Not applicable

Re: Conditional Format of OUTPUT

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.

Highlighted
Super User
Super User

Re: Conditional Format of OUTPUT

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

Highlighted
Anonymous
Not applicable

Re: Conditional Format of OUTPUT

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 🙂

 

 

Highlighted
Super User
Super User

Re: Conditional Format of OUTPUT

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

Highlighted
Anonymous
Not applicable

Re: Conditional Format of OUTPUT

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])

Highlighted
Helper III
Helper III

Re: Conditional Format of OUTPUT

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
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,689)