[SalesForce] OR AND IF combination – Process Builder

I'm using the current formula but I am getting an error when I save:'The formula expression is invalid: Incorrect parameter type for function 'OR()'. Expected Boolean, received Text'

Where do I need to look to correct this in the formula? Whats the best way to find the root of the problem with a formula with multiple functions?

IF (
OR (ISPICKVAL ([Case].Flagged__c , "C")
,
(AND (
ISPICKVAL([Case].Flagged__c , "O"),
[Case].Option__c = FALSE) ) , "High",""))
||
IF(
OR (
AND (IF (ISPICKVAL ([Case].Flagged__c , "Me"), 
[Case].Option__c = FALSE),

AND (ISPICKVAL([Case].Flagged__c , "Others"), 
[Case].Option__c = TRUE) , "Medium","Low")
)
)

Best Answer

You are using || (pipe sign operator) in process builder formula but it's not allowed so you can do it in this way:

OR(
IF (
OR (ISPICKVAL ([Case].Flagged__c , "C"),
(
AND 
(ISPICKVAL([Case].Flagged__c , "O"),
[Case].Option__c = FALSE)), "High","")),
IF(
OR (
AND (IF (ISPICKVAL ([Case].Flagged__c , "Me"), 
[Case].Option__c = FALSE),

AND (ISPICKVAL([Case].Flagged__c , "Others"), 
[Case].Option__c = TRUE) , "Medium","Low")
)
)
)