0

I am trying to achieve the following logic with a formula in process builder.

  1. If WRM ID and/or ICMS ID exists then include in Subject
  2. If neither exist include the other relevant IDs
  3. Regardless of what IDs exist, always include the info from the Address field

I have tried several different variations and the problem I run into is that the other IDs will be included when they shouldn't OR only WRM ID will show and not ICMS or vice versa. My main question is, what order would you recommend I build it in? And what is the best way to show the AND and OR statements.

First version, issue was only included WRM ID if entered, excl ICMS ID:

[Case].Migrated_Case_Number__c  & 
IF(NOT(ISBLANK([Case].WRM_ID__c))," | " & "WRM ID: "&[Case].WRM_ID__c,
IF(NOT(ISBLANK([Case].ICMS_ID__c))," | " & "ICMS S/O: "&[Case].ICMS_ID__c, 
IF(NOT(ISBLANK([Case].iTools_ID__c))," | " & "iTools WP: "&[Case].iTools_ID__c,
IF(NOT(ISBLANK([Case].OUT_ID__c))," | " & "OUT/Fault: "&[Case].OUT_ID__c,
IF(NOT(ISBLANK([Case].NCR_ID__c))," | " & "Audit Result Number: "&[Case].NCR_ID__c,
IF(NOT(ISBLANK([Case].Track_Trace_Number__c))," | " & "NCR ID: "&[Case].Track_Trace_Number__c,""
))))))
&
IF(NOT(ISBLANK([Case].Affected_Address__c))," | " &[Case].Affected_Address__c.Name,"")

Second version, issue was Itools would appear even though ICMS ID was filled in:

[Case].Migrated_Case_Number__c  & 
IF(NOT(ISBLANK([Case].WRM_ID__c))," | " & "WRM ID: "&[Case].WRM_ID__c,
IF(NOT(ISBLANK([Case].iTools_ID__c))," | " & "iTools WP: "&[Case].iTools_ID__c,
IF(NOT(ISBLANK([Case].OUT_ID__c))," | " & "OUT/Fault: "&[Case].OUT_ID__c,
IF(NOT(ISBLANK([Case].NCR_ID__c))," | " & "Audit Result Number: "&[Case].NCR_ID__c,
IF(NOT(ISBLANK([Case].Track_Trace_Number__c))," | " & "NCR ID: "&[Case].Track_Trace_Number__c,""
)))))
&
IF(NOT(ISBLANK([Case].ICMS_ID__c))," | " & "ICMS S/O: "&[Case].ICMS_ID__c, "")
&
IF(NOT(ISBLANK([Case].Affected_Address__c))," | " &[Case].Affected_Address__c.Name,"")

When I attempted a third version showing an OR statement as below I got an error:

[Case].Migrated_Case_Number__c  & 
IF(NOT(ISBLANK([Case].WRM_ID__c))," | " & "WRM ID: "&[Case].WRM_ID__c,
&
IF(NOT(ISBLANK([Case].ICMS_ID__c))," | " & "ICMS S/O: "&[Case].ICMS_ID__c, 
|| 
IF(NOT(ISBLANK([Case].iTools_ID__c))," | " & "iTools WP: "&[Case].iTools_ID__c,
IF(NOT(ISBLANK([Case].OUT_ID__c))," | " & "OUT/Fault: "&[Case].OUT_ID__c,
IF(NOT(ISBLANK([Case].NCR_ID__c))," | " & "Audit Result Number: "&[Case].NCR_ID__c,
IF(NOT(ISBLANK([Case].Track_Trace_Number__c))," | " & "NCR ID: "&[Case].Track_Trace_Number__c,""
))))))
&
IF(NOT(ISBLANK([Case].Affected_Address__c))," | " &[Case].Affected_Address__c.Name,"")

The formula expression is invalid: Syntax error. Found '&'

Any ideas are welcome, including links to helpful docs, I have really struggled to find info to assist.

1
  • Can you explain what exactly you need to update using process builder? Commented Oct 11, 2022 at 1:53

1 Answer 1

1

This is the final formula I came up with and it seems to satisfy the requirements

[Case].Migrated_Case_Number__c &
    IF(NOT(ISBLANK(TEXT([Case].Field_Services_Escalation_Type__c))), " | "& TEXT([Case].Field_Services_Escalation_Type__c), "" ) 
    &
    IF(NOT(ISBLANK([Case].WRM_ID__c & [Case].ICMS_ID__c)), " | " & "WRM ID: " & [Case].WRM_ID__c & " | " & "ICMS S/O: " & [Case].ICMS_ID__c,
    IF(NOT(ISBLANK([Case].WRM_ID__c)), " | " & "WRM ID: "&[Case].WRM_ID__c,
    IF(NOT(ISBLANK([Case].ICMS_ID__c)), " | " & "ICMS S/O: "&[Case].ICMS_ID__c,
    IF(NOT(ISBLANK([Case].iTools_ID__c)), " | " & "iTools WP: "&[Case].iTools_ID__c,
    IF(NOT(ISBLANK([Case].OUT_ID__c)), " | " & "OUT/Fault: "&[Case].OUT_ID__c,""
    )))))
    &
    IF(NOT(ISBLANK([Case].Affected_Address__c))," | " &[Case].Affected_Address__c.Name,"")

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .