Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Replacing PPTX XML Values with Find and Replace Does Not Work Everytime

alishadhillon__
8 - Asteroid

I have followed several blogs to:

 

1. Template my PPTX, Unzip this, locate the XML, bring this into an input within Alteryx.(manual unzip/ import)

2. Transform this and use and find and replace to replace the template values with the new values.

3. Output and package this to check. (manual zip)

 

I noticed that in step 2. The XML does not always replace the way that I have set up the logic. Some template values are replaced whilst others are not. Upon investigation of the XML, the tags seem to separate out the beginning of the value similar to this example here: 

 

https://stackoverflow.com/questions/1729969/ms-word-splits-words-in-its-xml-format

 

This means that the template value cannot be recognized and so it cannot appropriately find and replace.

 

Has anybody got more robust solutions to getting around this?

 

Thanks in advance! 

3 REPLIES 3
PhilipMannering
16 - Nebula
16 - Nebula

Does this happen when the user updates/inserts/makes changes to their parameters?

 

I doubt this would work, but you could try cleaning it up by parsing out the xml <w:t> tags. I don't know how you would identify the different text boxes, but based on the snippet of xml you linked to, you can combine that one tag back to it's original, in lieue of making sure the user doesn't update their parameters.

 

alishadhillon__
8 - Asteroid

Hi @PhilipMannering

 

I did replace the grid values for fake template values for my find and replace. I should caveat that the grids are heavily formatted so the string splits into something like this:

 

 <a:t>{{</a:t>
                                            </a:r>
                                            <a:r>
                                                <a:rPr lang="en-US" sz="1100" kern="1200" dirty="0">
                                                    <a:solidFill>
                                                        <a:srgbClr val="000000"/>
                                                    </a:solidFill>
                                                    <a:effectLst/>
                                                    <a:latin typeface="+mn-lt"/>
                                                    <a:ea typeface="+mn-ea"/>
                                                    <a:cs typeface="Times New Roman" panose="02020603050405020304" pitchFamily="18" charset="0"/>
                                                </a:rPr>
                                                <a:t>REPLACE}}</a:t>
                                            <a:r>
 
I was wondering if it made sense to change it from XML to something else and then back again or any suggestions on cleaning. I'll look at what you have suggested now. Thank you!
OllieClarke
15 - Aurora
15 - Aurora

@alishadhillon__ again, not sure this will work, but instead of having template values which can be split, can you use a single character which you find and replace? then it can't be split up?

Labels
Top Solution Authors