I built a flow to abstract a GUID from email body when new emails come in. The email body could contain:
3932FB4C-0DF5-11E8-A5C3-7804C4623542
or
KeyStart***3932FB4C-0DF5-11E8-A5C3-7804C4623542***KeyEnd
I have built the following expression to extract the GUID
if(greater(indexof(body('Html_to_text'), '***KeyEnd'), 1),
substring(body('Html_to_text'), Add(indexof(body('Html_to_text'), 'KeyStart***'), 11), 36),
substring(body('Html_to_text'), 0, 36))
For the second case, it works. For the first case, it always returns "index out of range" in the substring. Does anyone know why?