Question


VA
US
Last activity: 23 May 2025 14:39 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?


Pegasystems Inc.
US
@JahriC17390650 You are trying to do this in a single part. You need one automation that populates the table. After the table has finished populating (in your case after ListLoop2 has completed), you can then get a value out of it. You are trying to get value 45 out of the table before it has been added to the table. Add everything to the table first and then use the Completed execution path out of ListLoop2 to call GetRecord.
Updated: 23 May 2025 9:58 EDT


VA
US
@ThomasSasnettSo I broken up the automation some and it does loop through the values but I'm hoping that when I place ten as the key index it would just populate GA since its the tenth entry. I appreciate your patience and help with this. i know these are amateur issues.
I also tried using the completed method from listloop2 and calling get record but same results


Pegasystems Inc.
US
@JahriC17390650You are still inside of the loop when you are jumping to GetRecord. You must use the Completed execution path off of ListLoop2 to jump to GetRecord. ListLoop2 is adding all of the states to the table. From where you are jumping to GetRecord, you only have the one state you saw in your message box in the table. You need to add them all first.


VA
US
@ThomasSasnett understood. When I do that it just gives me the complete message 50 times.


Pegasystems Inc.
US
@JahriC17390650Right. You don't need a message box there. ListLoop2 is iterating over each of the fifty states and adding each one (one at a time) to the lookup table. Your Jump Label is then accessing one of the 50 states that have been added to the table after all 50 have been added.


Pegasystems Inc.
US
@ThomasSasnett This is why you want these in two separate automations. The part with ListLoop2 would be called from the ProjectStarted event since it only needs to be done once. Whenever you then read from your PDF later, that event would trigger whatever steps are involved in reading the PDF and then you'd be able to retrieve a value from the table since it was already fully populated on startup.


VA
US
@ThomasSasnettSo I was finally able to make sense of it hard coded but now trying to make sure the pdf is open in the right place for my overall automation is another kind of puzzle I don't think I can solve through text. Going to reach out to Tricia to see if I can get a walkthrough on how to make these pieces work.
Thanks again.


VA
US
@ThomasSasnett hours later I finally figured out what I was doing wrong. Thanks again for your patience I owe you a cup of coffee!