Show/Hide a group of items based on whether a word from a data merge is present in that group.

Community Beginner ,
Aug 16, 2022 Aug 16, 2022

Copy link to clipboard

Copied

Basically, I have a file pulling data from a CSV, and I want to know if there is a way to show/hide the 'oestradiol', 'prostate' and 'testosterone' titles and description text, if the text within the coloured circle is "none".

The text within the coloured circle is using a grep style that displays red/green based on whether the field says 'safe' or 'unsafe'. I was going to have this show no colour when "none is present", but not sure how to show/hide the title and description.

 

I've attached a mock file of what I mean, if someone can look over it to help me out?

 

Hopefully what I'm explaining I need makes sense?

 

Screenshot 2022-08-16 at 19.12.58.png

TOPICS
Feature request , How to , Import and export , Print , Scripting , Type

Views

56

Likes

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 Expert , Aug 17, 2022 Aug 17, 2022

Hi @KuriousKatie ,

this thread here is related to the one you also did some days ago:

 

Show/Hide certain elements on page, when certain text is visible in specified area
KuriousKatie, Aug 10, 2022

https://community.adobe.com/t5/indesign-discussions/show-hide-certain-elements-on-page-when-certain-text-is-visible-in-specified-area/td-p/13126627

 

From your posted csv file I can see that the first entry of e.g. Oestradiol is simply none.

Should that be the trigger to hide the unit of elements altog

...

Likes

Translate

Translate
Community Expert ,
Aug 17, 2022 Aug 17, 2022

Copy link to clipboard

Copied

Hi @KuriousKatie ,

this thread here is related to the one you also did some days ago:

 

Show/Hide certain elements on page, when certain text is visible in specified area
KuriousKatie, Aug 10, 2022

https://community.adobe.com/t5/indesign-discussions/show-hide-certain-elements-on-page-when-certain-...

 

From your posted csv file I can see that the first entry of e.g. Oestradiol is simply none.

Should that be the trigger to hide the unit of elements altogether?

 

I could accomplish this with the same basic technique that I suggested here:

 

Conditional Formatting to shapes from CSV text
KuriousKatie, Aug 01, 2022
https://community.adobe.com/t5/indesign-discussions/conditional-formatting-to-shapes-from-csv-text/t...

 

A technique you also implemented in your InDesign template file for the data merge you attached in your initial post.

 

What I changed:

All text of a single unit runs in one single paragraph. I added a forced line break for the first line and another forced line break character for the second line. To all the text paragraph style AllTextOfUnit is applied that has some specialities:

There are two line styles that come along with this paragraph style for the formatting of the first two lines. Plus one GREP Style that triggers a different formatting for the whole paragraph when the word "none" is between the first and the next forced line break. See screenshots below. Note, that this GREP pattern is not bullet proof, but so far it works for your sample document:

 

220817-1-DataMerge-Template-New-1.PNG

 

220817-1-DataMerge-Template-New-2.PNG

 

Your initial set-up of elements is positioned above the yellow rectangle not visible in the screenshots above.

Here the merged document pages 1 to 3:

220817-2-DataMerge-MergedDoc-Page-1.PNG

220817-2-DataMerge-MergedDoc-Page-2.PNG

220817-2-DataMerge-MergedDoc-Page-3.PNG

 

Just an option to show the principle of this technique.

 

If this scenario and set-up of the template will fit all your data source purposes is unknown to me.

Oh, to avoid overset after the merge I set the bottom most text frame of every unit to auto-height.

 

And, perhaps the more important question:

If one item turns "invisible" or "white" (with white background) should the following items move to fill the gap in the row of units? If that's the case, I think only scripting can do this automatically.

 

Regards,
Uwe Laubender
( Adobe Community Professional )

 

EDITED: Corrected the title of the mentioned thread.

Likes

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 ,
Aug 17, 2022 Aug 17, 2022

Copy link to clipboard

Copied

I think what you have suggested there might work!

Would you be able to save and send a copy of the amended file you have altered, so I can look in detail what you have done to the paragraph style/grep style? (A little difficult to grasp, as some of the items are not in english) 🙂

Likes

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 ,
Aug 17, 2022 Aug 17, 2022

Copy link to clipboard

Copied

LATEST

Hi @KuriousKatie ,

download the changed data merge template from my Dropbox account:

https://www.dropbox.com/s/y0au7rhz4s7flog/Medical%20Report%20Mock-TEMPLATE-CHANGED.indd?dl=1

 

Regards,
Uwe Laubender
( Adobe Community Professional )

Likes

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