Logical Help requested

Hello guys ! I got an interesting usecase for no-code developers on n8n. Improving this kind of workflow can solves many different types of conditionnal problem for no-code users likes me, here’s the use case :

  1. I got this text in HTML :
<p>Lorem ipsum dolor sit amet...</p>
<p>Lorem ipsum dolor sit amet...</p>

<h2><span style="background-color: #ffff00;">Compte Google</span></h2>
<div>Lorem ipsum dolor sit amet...</div>

<h2><span style="background-color: #ffff00;">Calendrier</span></h2>
<p>Lorem ipsum dolor sit amet...<strong><a href="https://docs.google.com/spreadsheets/d/{{ $json.sheetId }}/">Lorem Ipsum</a></strong>Lorem ipsum dolor sit amet...</p>

<h2><span style="background-color: #ffff00;">Contrat</span></h2>
<div>Lorem ipsum dolor sit amet...</div>

<h2><span style="background-color: #ffff00;">Modalités Pédagogiques</span></h2>
<p>Lorem ipsum dolor sit amet...<strong><a href="https://drive.google.com/drive/folders/{{ $json.gDModuleId }}">Lorem Ipsum</a></strong></p>

<h2><span style="background-color: #ffff00;">Feuilles d'é...</span></h2>
<div>Lorem ipsum dolor sit amet...</div>

<h2><span style="background-color: #ffff00;">On Boarding</span></h2>
<div>Lorem ipsum dolor sit amet... <strong>Lorem Ipsum</strong></div>


<h2><span style="background-color: #ffff00;">Paiement</span></h2>
<p>Lorem ipsum dolor sit amet...&nbsp;<strong><a href="{{ $json["Ids RIB"] }}">Lorem Ipsum</a></strong>.</p>

<h2><span style="background-color: #ffff00;">Fin</span></h2>
<p>Lorem ipsum dolor sit amet...<br />

For every <h2> I have have to Adapt OR Remove some parts of the text. You can see on the screen number 2 that it can became a huge workflow depending on the numbers of variables…



So is there a way to just write the part of the code (with the HTML template maybe ?) In order to reduce the size of the workflow and for fix it the best way in case of trouble.
Thanks for thoses who will try to help me with this kind of use case that can be really useful ! :slight_smile:

Hey @Jean_WILLAME,

The best I can think of would be to use a code node to make all of the changes. It would reduce the size of the workflow and it would result in some complex code but it would get the job done.

Hey @Jon

Thanks for your reply

Ok i’ll try this option. I’ve recently tried to use the Generate Template HTML node but the fact i’m doing conditionnal and templating in the same node with differents language is apparently confusing (but i’m probably doing some mistakes in the syntaxe so I have to go back in it).

I’ll try to do a code node after this.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.