How do I update the filter on a query through SOAP? | Community
Skip to main content
Level 2
July 29, 2020
Solved

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

  • July 29, 2020
  • 3 replies
  • 3057 views

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>

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jonathon_wodnicki

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

3 replies

Venu_Reddy
Level 6
July 30, 2020

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_liuAuthor
Level 2
July 30, 2020

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_liuAuthor
Level 2
August 10, 2020

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?

Jonathon_wodnicki
Community Advisor
Jonathon_wodnickiCommunity AdvisorAccepted solution
Community Advisor
August 13, 2020

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