1. Miraben Apani
  2. SnapDevelop
  3. Tuesday, 3 January 2023 15:52 PM UTC

I am working on Retrieving data window data which has a dropdwonlist through WEB API, developed in SnapDevelop.How do you Retrieve a dropdownlist through WEB API and display its DisplayColumn property ,instead of DataColumn property? 

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 3 January 2023 16:06 PM UTC
  2. SnapDevelop
  3. # Permalink

Hi Miraben;

  1. Use the RESTClient PB object to call your Web API
  2. Use the JSONParser object to read the Web API result set & populate the DDLB.

// OR

  1. Use the RESTClient PB object to call your Web API and return the JSON result set into a DataStore based DataWindow
  2. Loop through the DWO under script control & load the DDLB from the DWO's primary buffer.

HTH

Regards ...Chris

 

Comment
There are no comments made yet.
Miraben Apani Accepted Answer Pending Moderation
  1. Tuesday, 3 January 2023 20:14 PM UTC
  2. SnapDevelop
  3. # 1

Thanks for your response Chris.

I am actually looking for DropDownDatawindow. In my case, I am retrieving Data window from Table A which has "Code" column saved in that table (Table A). My dropdowndatawindow is using Table B which has Code and Decode column , so DataColumn  property is set to Code and Display Column property is set to Decode, now when I am retrieving data using RESTCLient Object I am only getting DataColumn value which is Stored in Table A actully, I need Display Column value (Decode column from Table B). 

Any suggetions?

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 3 January 2023 20:52 PM UTC
Hi Miraben;

Using the RESTClient PB object to call your Web API and return the JSON result set into a DataStore for the DDDW is great.

The next thing that I would do is .....

A) Use a GetChild() command in the parent DWO's coiumn to get the "address" of the (child) DDDW.

B) Use a ShareData() command to share the DataStore's primary buffer with the DDDW's // OR

Copy the DataStore DWO's primary buffer to the DDDW's primary buffer (from step A).

HTH

Regards ... Chris
  1. Helpful 1
  1. Chris Pollach @Appeon
  2. Tuesday, 3 January 2023 21:23 PM UTC
PS: Make sure that ...

1) the PS DBMS User has the appropriate Table / Column update privileges as the one used in your Native PB App

2) Make sure that the PS Test environment is pointing to the same DBMS instance as the native PB App.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.