Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

getSvcComponentsConfig(criteriaToMatch, options)

Updated on July 20, 2021

Calls the Constellation Service to fetch the corresponding component config.json file that satisfies the specified properties. This call is authenticated by the Constellation Service, using the issued B2S JWT token.

Returns

A Promise that resolves to an object with key data and value of the array of config objects matching the criteria.

Parameters

NameTypeDescriptionRequired
criteriaToMatcharrayThe list of name-value pairs specifying the search criteria.
optionsobjectThe object that contains information to obtain additional config-ext.json values.

The following table contains the properties of the options object:

NameTypeDescriptionRequired
alternateDesignSystemURLstringThe URL for an alternative design system, used for fetching additional config-ext.json values.

Usage example

In this example, the API retrieves an operator image and creates a DOMString containing a URL representing the image Blob object.

const templateDefinitionConfigJson = await AssetLoader
     .getSvcComponentsConfig([{ field: 'name', value: ‘OneColumn’ }])    
     .then((response) => {
        if (response?.data?.components?.[0]) {
          return response.data.components[0];
        }
        throw new Error('templateDefinition for OneColumn not found!');
     })
     .catch(() => {
        throw new Error('templateDefinition for OneColumn not found!');
     });

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us