LightningFlowComponents
LightningFlowComponents copied to clipboard
DataMapper - Make HTTP Action - URL validation prevents use of named credential
Steps to reproduce
Steps to reproduce the behavior:
- Create an Apex action of the Make HTTP Action
- Fill in an url of the callout:named_credential_name
- Try to save the action
- See the error invalid url
Expected behaviour
A callout with a named credential as url will work with the underlying apex class making the callout, therefore the CPE editor should not prevent using a named credential as an endpoint.
Actual behaviour
The regex used to validate the url will invalidate the url and prevent saving.
Workaround
Creating the url as a formula text value will prevent the validation from working.
Solution
The regex validation (from line 157 onwards) for the url should be conditional
if(url.StartsWith('callout:'))}else{ etc}
Possibly validating instead in this scenario that there are only letters and underscores used for the credential name.
E.g. [a-zA-Z0-9_]+ ?