Question


VA
US
Last activity: 22 May 2025 14:08 EDT
Lookup Table Values
So I have a pdfconnector that has a combo box value that isn't being accepted properly but the selected index value populates. I was wondering if there was a way to use an external file with the values and have those pair up with the index similar to a switch but not having the hassle of creating 357 entries in a switch.
There is an open ticket on the form and the combo box field as I have had it inspected by an expert before.
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 21 May 2025 15:44 EDT


Pegasystems Inc.
US
@JahriC17390650 That's too many for me to want to do. Can you get that list electronically somehow? If you can, you can also load a lookup table in a variety of ways. If you have a delimited list of all of the items you wanted to add in order by their index, you could then write a quick automation to load those up. If you cannot get the list electronically though, you'd have to manually enter them all. Let's say you had the list, and it looked like the list of US States.
AL,AK,AZ,AR,CA,CO,CT,DE,FL,GA,HI,ID,IL,IN,IA,KS,KY,LA,ME,MD,MA,MI,MN,MS,MO,MT,NE,NV,NH,NJ,NM,NY,NC,ND,OH,OK,OR,PA,RI,SC,SD,TN,TX,UT,VT,VA,WA,WV,WI,WY
You could do something like to populate the table.


Pegasystems Inc.
US
@JahriC17390650 A lookup table would do this. You define the fields you want in the table (I would make the index the key field and then the text value the other field). You can create an automation to populate this table off of the ProjectStarted event (you can get this from the Toolbox), especially if there are only a handful of values to add to it. Use the AddRecord method to add to it and the GetRecord to retrieve your text value based on the index.


VA
US
@ThomasSasnett so would the recommendation then be to manually input the 357 values into the lookup table?
Accepted Solution
Updated: 21 May 2025 15:44 EDT


Pegasystems Inc.
US
@JahriC17390650 That's too many for me to want to do. Can you get that list electronically somehow? If you can, you can also load a lookup table in a variety of ways. If you have a delimited list of all of the items you wanted to add in order by their index, you could then write a quick automation to load those up. If you cannot get the list electronically though, you'd have to manually enter them all. Let's say you had the list, and it looked like the list of US States.
AL,AK,AZ,AR,CA,CO,CT,DE,FL,GA,HI,ID,IL,IN,IA,KS,KY,LA,ME,MD,MA,MI,MN,MS,MO,MT,NE,NV,NH,NJ,NM,NY,NC,ND,OH,OK,OR,PA,RI,SC,SD,TN,TX,UT,VT,VA,WA,WV,WI,WY
You could do something like to populate the table.


VA
US
@ThomasSasnett So I tried playing around with your solution but may not fully understand how it works. Here is a screenshot of what I have going on but not sure how to pass the selected index to be the key to the lookup table nor how to get it to pull the value.


Pegasystems Inc.
US
@JahriC17390650Let me make sure I understand your problem. As I understand it, you have a combo box on a PDF that has a preset amount of values in it. As of now, you can only retrieve the selected index from that combo box instead of the selected value. When you wish to retrieve data from the PDF, you need to translate that index value to the actual value. If that is accurate, here is what you are missing.
- You need to first populate the table off of the ProjectStarted event. Your table would have two columns; the Index (which would be the selected index from the combo box), and the Value (which would be the value that the selected index would translate to).
- Now that you have a table with the values populated, you can use the GetRecord to translate whatever the Selected Index is from your PDF into the actual value. You would call this after you had extracted the data from your PDF.
Does that make sense?


VA
US
@ThomasSasnettIn text it makes perfect sense. In Pega land I'm lost lol


Pegasystems Inc.
US
@JahriC17390650Think of this in parts. Do you have an automation you are running off of the ProjectStarted event that populates the table? Once you have that, that is step one. That is essentially the example I showed. Next, work on your automation to read your PDF. That will have an entry point and return all of the data you want to extract from the PDF. One of those values will be the selected index that you need to run through your table to get the real value. In that automation, I would use the GetRecord method from the LookupTable (since you have already populated it with data on ProjectStarted) and the output would be the value you want. Here is a simple example. You can replace the hard-coded value with your PDF steps, but the concept should be clear.


VA
US
@ThomasSasnett So I'm trying to playa round with it to understand how to use it properly and am still a bit confused. I attempted to hard code a specific index to see if the desired result would pop up but it shows up empty and then repeats while incrementing through each state. Where am I getting this wrong?