Hi Shubham Thanekar,
You can use substring() and find() functions to extract the text from the given string. For your reference, I am sharing that link below. It will be helpful for you.
https://community.mendix.com/link/questions/114660
Thanks and regards,
Vijjayabharathi V
If you need to extract 3 source from string you can use below approach.
you will get first source from below.
substring($APISource,0,find($ChatHistory/APISource,'[2]:'))
you can chek third source exist or not using below.
find($APISource,'[3]:')
if exist then you can extarct second source from below
substring($APISource,$SecondSourceexist,$ThirdSourceexist-$SecondSourceexist)
Than extract third source from below.
substring($APISource,find($ChatHistory/APISource,'[3]:'))