0

I have Flow with collection variable {!AccountIds} and it's value is following

{!AccountIds} = "[0011U00000oyv8UQAQ,0011U00000oyv8YQAQ,0011U00000oyv8YQAQ,0011U00000oyv8UQAQ]"

I'm using Formula in flow to fetch all value and get it as string.

enter image description here

so Now when I use this formula in Text component it shows

enter image description here

However I need this Values to be formated in this format

('0011U00000oyv8UQAQ','0011U00000oyv8YQAQ','0011U00000oyv8YQAQ','0011U00000oyv8UQAQ')

Is there any way this possible?

1
  • why are the accountIds all in a single string - what is the source of this string? Can that source be adapted to provide a collection rather than a delimited string? If not, you need to use invocable apex to split and return as a collection
    – cropredy
    Apr 7 '20 at 3:17
0

You can use SUBSTITUTE to replace the characters in the AccountsIds variable. In the formula below are three levels of SUBSTITUTE. First to replace , with ',', second to replace [ with (', and last one to replace ] with ').

SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE(
{!AccountID},"]","')"),
"[","('"),
",","','")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.