• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Grep to change background based on a word that is filled using data merge

Community Beginner ,
May 05, 2020 May 05, 2020

Copy link to clipboard

Copied

I am trying to use data merge to set up multiple items, but I need the background of each category to have a different color. In my example here I've got a column in my source file that designates PV for one category and D for another category. I need PV to always be a blue background with white text, D always needs to be a green background with white text. I've exhausted all of my searches to try to get a combination of Character Styles, Paragraph Rules & Styles, etc. Any thoughts? Thank you for your time.

Screen Shot 2020-05-05 at 9.17.53 AM.png

TOPICS
How to

Views

640

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , May 05, 2020 May 05, 2020

Thank you so much for the reply. Since posting this question I not only found a workaround, but the plan for the final design has since changed and will require a new approach. But to fill you in, my workaround was to just have two text boxes on top of one another. For the bottom text box I set a paragraph rule that applied the correct color via Character Style (PV was in blue and the paragraph rule was also blue). The top text box just set to white for character color in the Paragraph Style.

Votes

Translate

Translate
Community Expert ,
May 05, 2020 May 05, 2020

Copy link to clipboard

Copied

Hi Jason,

can you show your sample with hidden characters showing? Also frame edges showing?

That would make it easier to do some suggestions.

 

Are there any other data entries in the same category that start with a D followed by a blank?

Or a PV followed by a blank that should be colorized differently?

 

Are the entries done in table cells?

 

Regards,
Uwe Laubender

( ACP )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 05, 2020 May 05, 2020

Copy link to clipboard

Copied

LATEST

Thank you so much for the reply. Since posting this question I not only found a workaround, but the plan for the final design has since changed and will require a new approach. But to fill you in, my workaround was to just have two text boxes on top of one another. For the bottom text box I set a paragraph rule that applied the correct color via Character Style (PV was in blue and the paragraph rule was also blue). The top text box just set to white for character color in the Paragraph Style.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
May 05, 2020 May 05, 2020

Copy link to clipboard

Copied

Grep style! … So just let the data play!

 

Sample:

 

Capture d’écran 2020-05-05 à 19.58.12.png

 

(^/)  The Jedi

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 05, 2020 May 05, 2020

Copy link to clipboard

Copied

Hi Michel,

that it can be done with GREP Styles is really no question, I think.

But we need some answers from the OP to suggest a good, or put better, a bullet-proof, workflow.

 

Regards,
Uwe Laubender

( ACP )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines