cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Result of if containing fixed value + value of a field

ANLTH
Observer

Hi

I am looking for a way to make a combined output of an if statement.

Here is my DQL:

| fieldsAdd
`Flow Object` =
if(dt.source_entity_name == "cpi_message", "CPI Log " integration_artifact_name, else:
if(attributes.type == "c_IntegrationLog__c", "SF Integration Log" c_SourceSObject__c))

 

I need the result of the if statement to contain a fixed text i.g. CPI Log followed by the content of the integration_artifcat_name field.

 

 

 

2 REPLIES 2

GerardJ
Advisor

Hi @ANLTH 
Have you looked at the concat()  function ? from my understanding this could be what you want to do

Gerard

PedroSantos
Advisor

Hello @ANLTH ,

This was an interesting exercise.

You can try this:

| fieldsadd FlowObject =if(matchesphrase(dt.source_entity_name, "cpi_message"), (concat("CPI Log", " ", integration_artifact_name)), else:
if(matchesphrase(attributes.type, "c_IntegrationLog__c"), (concat("SF Integration Log", " ", c_SourceSObject__c))))

 

As @GerardJ mentioned, this makes use of the concat function and makes it work for you. I tested it successfully on my notebook end (with different parameters), so it should work for you as well 🙂 Let me know if it does!

Remember, you can always refer to DQL functions and/or String Functions on the documentation page to power up your DQL 🍻 But we're also happy to help.

To make an error is human. To spread the error across all servers in an automated way is DevOps.

Featured Posts