Last activity: 18 Oct 2020 21:47 EDT
Pega Robotics - How to get back the Dynamically changed text from Text adaptor to Pega RPA
We have an text adaptor automation - In one of the screen we validate the data and display error text at bottom of screen.
Have to capture the error text and get that back to RPA so that we can update Pega case.
The area in circled with red is the error text field.
Looking for suggestions.
Create a region for that area message appears in. Make sure you make it large enough to contain the largest message. Check the value of the region whenever you want to read the message.
Tried the approach - cannot read the text from the region. Please find below Automation path.
Doing a Null check and triggering dialog if it is empty but here it not triggering message dialog - taking the path to Exit.
But not getting any message. Even when try to print the text as message dialog- getting empty text.
You don't really have any waiting between enter and the error appearing. There's an event I like to use at the adapter level to use when navigating back to the same screen. The event is NewScreenShowing. This will fire whenever a new screen appears. In this case, I would wait for this event (add the event to your automation by selecting it from the adapter in Object Explorer and right-click it and select "wait for this event"). Use the Setup link of the wait for event to trigger your "SendKeyPlusEnter". The Fired will happen when there's a new screen and you can check to see which new screen is there (by using the IsCreated for each screen that might happen after clicking enter).
My normal flow in a Text adapter automation when I have a screen that can "error" and essentially re-appear is to use the following logic;
- Populate screen A.
- Use the WaitForEvent for the NewScreenShowing event.
- Off of the Setup link, trigger the "Enter" or whatever key takes you to the next screen.
- On the Fired link, go into a WaitAny (you can also use a series of IsCreated properties here too if that makes more sense) where you've connected any of the possible screens that might appear including the one you are currently on. Set the timeout on the WaitAny to 1 as you don't really need it to wait for any amount of time as this is just a shortcut to a series of IsCreated checks.
Thanks for your response. We have error coming up in same screen at the bottom after hitting Enter.
So made that error region as Partial screen and selected the text as region.
In the flow waited for Partial screen to get created and then capturing the Text. Still getting the empty text.
The partial screen will always be created essentially (depending on how you matched it). I would just make it a region on your screen. I don't think your WaitForInputAllowed is really doing anything, although we could see in a log if it is really waiting for anything. You can just add a large pause before you pull the text (right before your Exit add a 5000 ms pause or something large enough so that the error is present) to confirm that it is really a timing issue. If the pause gets the text, then you know that you just aren't waiting for the right thing. I would still suggest you implement my suggestion of using the wait for event.
Thanks for your inputs. Kept the pause for test and we got the result back.
Updated: 18 Oct 2020 21:47 EDT
That means that the NewScreenShowing event should work to allow you to get the results. A pause shouldn't really be relied upon since it might be too long or too short depending on the performance of the application.
Thanks for your inputs. NewScreenShowing worked and we were able get back the updated text.