LightningFlowComponents icon indicating copy to clipboard operation
LightningFlowComponents copied to clipboard

DataMapper - Make HTTP Action - URL validation prevents use of named credential

Open rutgergernandt opened this issue 3 years ago • 0 comments

Steps to reproduce

Steps to reproduce the behavior:

  1. Create an Apex action of the Make HTTP Action
  2. Fill in an url of the callout:named_credential_name
  3. Try to save the action
  4. 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_]+ ?

rutgergernandt avatar Apr 25 '22 22:04 rutgergernandt