Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

How do I update the filter on a query through SOAP?

perry_liu
Level 2
Level 2

In a workflow that contains existing query and filters, how do I use SOAP to update said filters? I've tried different things but I can't update a filter. Any help/instructions would be much appreciated.

 

My XML looks like this so far:

 

 

 

<?xml version='1.0' encoding='ISO-8859-1'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:xtk:session">
    <soap:Header xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"></soap:Header>
    <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
        <urn:WriteCollection>
            <urn:sessiontoken>{{sessiontoken}}</urn:sessiontoken>
            <urn:domDoc>
                <recipient-collection xtkschema="nms:recipient">
                    
                <recipient-collection>
            </workflow-collection>
        </urn:domDoc>
    </urn:WriteCollection>
</soapenv:Body>
</soapenv:Envelope>

 

 

 

This is the block in the workflow I'd like to update:

 

 

<query collision="0" distinct="true" img="nms:activities/query.png" keepAllExtraData="false"
             label="unique Key starts with 'some_value' and email of recipient contains 'perry' and cell Code equal to 'D01O'"
             mask="0" name="query" noAutoPk="false" noAutoPkFilter="false" onError="0"
             recipientLink="" runOnSimulation="true" schema="bell:campaignHistory"
             timezone="_inherit_" useSource="0" x="304" y="168">
        <transitions>
          <result enabled="true" label="Result" name="result" target="enrich"/>
        </transitions>
        <select>
          <node analyze="false" expr="@campaignCode" label="Campaign Code"/>
          ...(bunch of nodes)
          <node analyze="false" expr="@uniqueKey" label="Unique Key"/>
        </select>
        <where displayFilter="somedisplayfilter"
               filterName="somefiltername" id="3918004415">
          <condition boolOperator="AND" compositeKey="" dependkey="" enabledIf=""
                     expr="@uniqueKey LIKE 'some_value' + '%'" internalId="2538144714"/>
          <condition boolOperator="AND" compositeKey="" dependkey="" enabledIf=""
                     expr="[recipient/@email] LIKE '%' + 'perry' + '%'" internalId="2538144715"/>
          <condition compositeKey="" dependkey="" enabledIf="" expr="@cellCode = 'D01O'"
                     internalId="2538144716"/>
        </where>
        <humanCond>Query: unique Key starts with 'some_value' and email of recipient contains 'perry' and cell Code equal to 'D01O'</humanCond>
      </query>

 

 

 

filter insertOrUpdate SOAP
1 Accepted Solution
wodnicki
Correct answer by
Community Advisor
Community Advisor

Hi,

 

Use SOAPAction: xtk:persist#Write

 

<?xml version='1.0'?>
<SOAP-ENV:Envelope xmlns:xsd='http://www.w3.org/2001/XMLSchema'
	xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
	xmlns:ns='urn:xtk:persist'
	xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'>
	<SOAP-ENV:Body>
		<Write xmlns='urn:xtk:persist' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
			<__sessiontoken xsi:type='xsd:string'></__sessiontoken>
			<domDoc xsi:type='ns:Element' SOAP-ENV:encodingStyle='http://xml.apache.org/xml-soap/literalxml'>
				<workflow _operation="update" id="8620" xtkschema="xtk:workflow">
					<activities>
						<query _operation="update" label="1 equal to 1" name="query">
							<where _operation="delete" id="3450798105"/>
							<where _operation="insert" displayFilter="1 equal to 1" filterName="backGroundFilterFrm" id="3455451164">
								<condition compositeKey="" dependkey="" enabledIf="" expr="1 = 1" internalId="3455254554"/>
							</where>
							<humanCond>Query: 1 equal to 1</humanCond>
						</query>
					</activities>
				</workflow>
			</domDoc>
		</Write>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

 

Thanks,

-Jon

View solution in original post

7 Replies
Venu_Reddy
Community Advisor
Community Advisor

Hi @perry_liu ,

 

Yes, you can do it as below

 

<urn:strWorkflowId>WKF**</urn:strWorkflowId>

        <urn:strActivity>signal</urn:strActivity>

        <urn:strActivity>query</urn:strActivity>

        <urn:strTransition></urn:strTransition>

        <urn:elemParameters>

            <!--You may enter ANY elements at this point-->

        </urn:elemParameters>

perry_liu
Level 2
Level 2

Is the content within elemParameters like this:

<elemParameters>
                <variables>
                    <sysFilter>
                        <condition boolOperator="AND" expr="@uniqueKey LIKE 'SOMETHING_000' + '%'"/>
                        <condition boolOperator="AND" expr="[recipient/@email] LIKE '%' + 'perry' + '%'" />
                        <condition compositeKey="" dependkey="" enabledIf="" expr="@cellCode = 'TE3Q'"/>
                    </sysFilter>
                </variables>
            </elemParameters>
perry_liu
Level 2
Level 2

Another I tried is  but it doesn't seem to work:

 

<strTransition>query</strTransition>
           <elemParameters>
                <variables>
                    <sysFilter>
                        <condition boolOperator="AND" expr="@uniqueKey LIKE 'SOME_VALUE' + '%'"/>
                        <condition boolOperator="AND" expr="[recipient/@email] LIKE '%' + 'perry' + '%'" />
                        <condition expr="@cellCode = 'TE3Q'"/>
                    </sysFilter>
                </variables>
            </elemParameters>
            <bComplete>1</bComplete>

 

perry_liu
Level 2
Level 2
I still don't what to place within the <urn:elemParameters> to update the filter in the query. I can add variables to update the filter but how do I use this to add or remove filters from the query, or even all the filters?
perry_liu
Level 2
Level 2

With the answer above it doesn't give me a clear answer as to how to modify the filter in the query.

I still don't know what to place within the <urn:elemParameters> to update the filter in the query. I can add variables and utilize it to update the filter but how do I use this to add or remove filters from the query, or even all the filters directly?

wodnicki
Correct answer by
Community Advisor
Community Advisor

Hi,

 

Use SOAPAction: xtk:persist#Write

 

<?xml version='1.0'?>
<SOAP-ENV:Envelope xmlns:xsd='http://www.w3.org/2001/XMLSchema'
	xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
	xmlns:ns='urn:xtk:persist'
	xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'>
	<SOAP-ENV:Body>
		<Write xmlns='urn:xtk:persist' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
			<__sessiontoken xsi:type='xsd:string'></__sessiontoken>
			<domDoc xsi:type='ns:Element' SOAP-ENV:encodingStyle='http://xml.apache.org/xml-soap/literalxml'>
				<workflow _operation="update" id="8620" xtkschema="xtk:workflow">
					<activities>
						<query _operation="update" label="1 equal to 1" name="query">
							<where _operation="delete" id="3450798105"/>
							<where _operation="insert" displayFilter="1 equal to 1" filterName="backGroundFilterFrm" id="3455451164">
								<condition compositeKey="" dependkey="" enabledIf="" expr="1 = 1" internalId="3455254554"/>
							</where>
							<humanCond>Query: 1 equal to 1</humanCond>
						</query>
					</activities>
				</workflow>
			</domDoc>
		</Write>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

 

Thanks,

-Jon

View solution in original post