Question
Cognizant
IN
Last activity: 27 Sep 2023 2:18 EDT
Can we refer a single property with a data page on UI
We have a Countries drop down and this dropdown is being sourced by a data page (this data page is in turn sourced by a Connect REST)so now based on the country value we need to populate Currency filed which is read only single property(suppose i select country as India currency should auto-populate to INR).How to achieve this requirement.
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 27 Sep 2023 2:18 EDT
Infosys Limited
IN
As you are getting the country information through rest service, on change of the dropdown add the change event with action refresh section. Call the DT in the refresh section.
If you want to have the currency in pega. Then have one decision table which returns the currency when country is passed. Call this decision in the abov DT.
Or
If you dont want to maintain currency in pega environment, find the service which returns it. Call that service on the on change of country drop down
Or
If you are getting the currency from the existing service, well and good. Then maintain the currency alone in dynamic layout and add the refresh condtion like country value changes.
Bits in Glass
IN
@TanyaS58 if you are getting countries in the api, you can ask service provider to send the currency also, that would be the better approach. You can map that currency also to a property and use it in UI.
Cognizant
IN
@Anoop Krishna I didnt get how can we map the currency in a property from an external service?
Updated: 25 Sep 2023 22:45 EDT
Bits in Glass
IN
@TanyaS58 it's the same way like you map your country. That is also a string, so just set it to text property. It's just a property set in the response data transform where you set country property. So now you will have both countries list and corresponding currency in the dpage list results. On changing country, use the country selected on the same dpage and get the corresponding currency.
Bits in Glass
IN
Hi @TanyaS58
you can achieve this by using a Response Data Transform that sets the value of the Currency field based on the selected Country. for example:
-
Create a Data Transform:
- Name it something like “SetCurrencyBasedOnCountry”.
- In this Data Transform, create a row for each country you want to support. For example, if the selected country is “India”, set the Currency to “INR”.
-
Apply the Data Transform:
- In the section that contains your Country dropdown and Currency field, add an action to the Country dropdown.
- Set the event to “Change”, and the action to “Run Data Transform”. Select the Data Transform you created in the step.
Updated: 25 Sep 2023 6:42 EDT
Ryan
IN
"https://restcountries.com/v3.1/name/India?fullText=true" -- Try this API, you will get currency details based on the country name.
Documentation URL- https://restcountries.com/#endpoints-name.
Once you get the currency details, you can set the currency value to your read-only property by using activity or data transform(Apply at "on change" action on your country dropdown control).
Accepted Solution
Updated: 27 Sep 2023 2:18 EDT
Infosys Limited
IN
As you are getting the country information through rest service, on change of the dropdown add the change event with action refresh section. Call the DT in the refresh section.
If you want to have the currency in pega. Then have one decision table which returns the currency when country is passed. Call this decision in the abov DT.
Or
If you dont want to maintain currency in pega environment, find the service which returns it. Call that service on the on change of country drop down
Or
If you are getting the currency from the existing service, well and good. Then maintain the currency alone in dynamic layout and add the refresh condtion like country value changes.