27 Nov 2024 11:39 AM
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.
28 Nov 2024 03:22 PM
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.