Hey,
I need to parse a html list from a datastore, I want to get all text within
Wondering if anyone knows is this is possible? I feel like a need to regex the text but can’t figure out the param.
Hey,
I need to parse a html list from a datastore, I want to get all text within
Wondering if anyone knows is this is possible? I feel like a need to regex the text but can’t figure out the param.
For this, you will have to create a text parser (match pattern/regex) > iterator (to create a variable for each li) > Set Variables. I have attached the scenario.
The regex pattern is
<li>(.*?)<\/li>
BTW, my first post on this forum
Tried that but couldn’t seem to get an output in a bundle to parse.
Btw - congrats on the first post, I’m new to make but do a lot of php/nodejs and old school writing the code. Should be up there shortly.
@Chris_Bradley , I have also been a PHP dev for many years!
Could you please post a screenshot of the data store record?
Hey,
Looks like this:
<ul><li>Designed in Australia from solid 9k gold for a luxury appeal.</li><li>Features a typewriter-style 'Letter R' charm, perfect for personalisation.</li><li>Can be layered with other Luna Letters for a unique look.</li><li>Also available as a standalone charm for versatility in accessorising.</li><li>The charm weighs a light 0.21 grams for comfortable everyday wear.</li><li>Charm dimensions of 11mm x 3.6mm offer distinct yet subtle elegance.</li><li>Perfect as a token of enduring affection or a personalised gift.</li><li>Solid gold offers timeless sophistication and premium quality.</li><li>Chain measures 40cm, perfect for a close-to-heart placement.</li><li>Includes a Figaro chain for a delicate balance of durability and style.</li></ul>
I would ideally love to parse this into seperate variables to push to Google shopping (highlights). I was kind of hoping the out of the box was an array, but seems i need to parse as seperate variables.
I have the ability to table the data, so could also just add to table, parse that (which seems more out of the box) and ten set to vars in the iteration and push out.
PHP is a strong lang, I do alot in nodejs as of late, but have a good understanding of php/laravel. I guess i would perfer to workflow these things more that code from scratch but struggle with the defined limitations (which i get) of the platform.
I have though about pushing these to a data-store.
I currently call an API to get the results, but would need to effectively get the object and process as an array then push it to the item before committing to the data-store (on an item level).
Little bit out of my knowledge (day 1 on make.com here).
Hi @Chris_Bradley, Great solution by @Ronak_Bhagdev and congratz on the first post. I just stumbled on a stripHTML() native function and this might be useful, along with split() function.
If you want to generate an array of bulleted elements, you’d simply have to reference this in future modules or variables :
split(stripHTML(text);newline)
WHERE text = inputtext AND newline = make native function (pink one).
This ideally consumes no operations opposed to the regex solution, and regex being a pain in the bum, might be easier for newbies. U can also use trim() function along with strip to trim extra whitespaces.
Cheers
legend, I guess I was stuck on a different type of text parser here
Should be easy enough to split the bundles to variables with a variant set against a number of the item in the array.
thanks
hit me up if you need anything at all
considered stripeHTML() but as a loose the the defining parts of the what is effectively a list array, i would then need to make some subjective decisions. I think better to isolate the values within the <li>
tag’s and then put then into an array and then set them to variables (with a float of the iteration number at the end. (if that makes sense.
Glad to hear that @Chris_Bradley. Please mark my solution as resolved if it finally worked for you.