Usecase: we will show how to access data from an external REST service using service connection - Define by endpoint option.
Highlevel steps:
- Create a service connection to an external rest endpoint
- Create a type and variable from the rest endpoint
- Add fields to the employees edit page to display country data
- Bind the created country avatar, input fields to the created country type variables.
- Assign data to variables
- Test the employee's country details
Implementation steps:
Step1: create a service connection to an external rest endpoint
Web apps >> Services >> click + service connection >> wizard will show 3 options >> select define by endpoint >> select method, provide URL and select action >> create backend
Here, we have mentioned below details:
Method: get
URL: https://restcountries.com/v2/alpha/{code}
action: Get one
Step4:Bind the created country avatar, input text fields to the countryType variable
Go to the page designer >> select avatar >> click data tab >> src field >> select the created country type variable and flag >> sameway for region and timezone and src >> add the variables
Step5: assign data to the variable
Select country field data >> add on value event that triggers an action chain >>>> from where we use rest call action and select the endpoint service >> assign input parameter >> expand employee under page and map country to code. >> drag and drop assign variable >> select countrytypevar >> which maps to callrest response body
No comments:
Post a Comment