Change in outlook filter without changing code

Hello I am using below mentioned outlook filter
@SQL=urn:schemas:httpmail:subject Like ‘%ABC%’ AND urn:schemas:httpmail:fromemail Like ‘%BOT1%’ AND urn:schemas:httpmail:textdescription Like ‘%PQR%’

But now I don’t want to use from email filter but I don’t wnat to change code as well.

Thanks in Advance

Can anyone suggest anything by which we can remove/escape this w/o code change

@anjasing,

You will have to maintain this filter query in Config file or any SharePoint file which would be available to update at anytime without redeploying the code.

Change your hardcoded value with a variable in which you would be reading this.

There would be one time code change required though initially. Without this change it’s not possible in your current code.

Thanks,
Ashok :slight_smile:

1 Like

we will surround urn…

"@SQL=(""urn:schemas:httpmail:subject"" Like ‘%ABC%’) AND (""urn:schemas:httpmail:fromemail"" Like ‘%BOT1%’ ) AND (""urn:schemas:httpmail:textdescription"" Like ‘%PQR%’)"

and could parameterized it by variables or as an externalized string (when hardcoded the values)

1 Like

Can you please suggest how can I put this query in config?

as this query starts with @ and Excel would take it as a formula?

but it’s already hardcoded in the code. How can I change it without changing code? like in config /asset changes if they can help?

@anjasing,

Try putting like this.

"@SQL=""urn:schemas:httpmail:subject"" Like ‘%ABC%’ AND ""urn:schemas:httpmail:fromemail"" Like ‘%BOT1%’ AND ""urn:schemas:httpmail:textdescription"" Like ‘%PQR%’
1 Like

Hi @anjasing

There is two ways to do this,
→ When you are developing the code, you have to store the expression in the Orchestrator Asset then use the Get asset activity to retrieve the asset from Orchestrator and store in a variable then pass that variable to the Filter expression in Mail activity.

→ Or if you are using the Config file store the Expression in config file then pass that in the filter expression field in mail activity.

Hope it helps!!

1 Like

As answered:
parameterized it by variables
OR
externalized string (when hardcoded the values)

But you cannot byPass Compilation

Another technique can be

  • using a template with placeholder
  • set placeholder keyValues in the config
  • Construct dynamized the filter
1 Like

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