lundi 12 juillet 2021

How to return a section of a string and if not found return an error(Apex Error). What's wrong with my code?

import re #search using regex process_builder_name = input_data['process_builder_name'] #process_builder_name = re.findall(r'"([^"]*)"', process_builder_name)

if process_builder_name == re.findall(r'"([^"]*)"', process_builder_name):
    return  process_builder_name 
else:
    print ('Apex Error')

error_details = input_data['error_details']
five_lines = error_details.split(".")
return 'error_details': ".".join(five_lines[:5]) 

Aucun commentaire:

Enregistrer un commentaire