SAP Field Dynamic Selector

Hi All,

I’ve come across an issue while trying to automate a sub process of an invoice verification process. The objective is to capture the PO Number using a ‘Get Text’ activity and store it in a variable for later use. However after the initial invoice PO is captured and the Bot proceeds to the next invoice the selector for the text field becomes invalid as it changes from invoice to invoice. I’ve tried using the * sign to indicate the possible change but i’m finding it difficult to figure out the right syntax to do so.

Example : The Numbers 46:0389, 46:0406, 46:0401 vary from invoice to invoice.


Any suggestions are greatly appreciated, Thank you in advance! :slight_smile:


Welcome to the UIpath Community.

Could you please post screenshot of the Selector for two different invoices and Selector you made dynamic one. Will check it and let you know.

Hi Lakshman,

I hope these 2 examples will suffice.![Invoice_1|690x22]

Thank you! :slight_smile:


Have you replaced that text highlighted with red box using wild card “*” or not ?

Hi Lakshman,

Yes, i tried using the wild card but it still doesn’t work. I think its not working because of the " : " in the middle of the variable?

Please advice.

try using “*:*”

Hi Shubhi,

I’m afraid i still cant get it to work. After many iterations i checked, the “SAPLDISPLAY46:” is constant. So is there a way to concatenate and build the selector like this?

sap id =‘usr/subSUB_MAIN:/COCKPIT/SAPLDISPLAY46:’ & * & ‘/subSUB_HDR:/COCKPIT/’
sap id =‘usr/subSUB_MAIN:/COCKPIT/SAPLDISPLAY46:’ + * + ‘/subSUB_HDR:/COCKPIT/’

Thanks in advance! :slight_smile:

Hi @Johann,

Seems pretty good example for you to understand the Selectors. hope, this approach will help you.

  1. Use “Get attribute” activity to get the id value from the selector.
  2. Once you get the value, use regex to get the first occurrence value why because in ID there are two value which shares same structure of data.
  3. Pass the output of the second step to “Get text” activity.

In this way you can pass dynamic values to the selectors.

Sukesh V

Hi Sukesh,

Thank you for your suggestion. However, i already tried this method. As the PO Field ID changes with each invoice, the “Get Attribute” can only return the Field ID if the selector matches the initial selector :confused: so extracting the ID seems fruitless.


Hi ,

Can you try to extract using “Image activities” or using OCR?

Sukesh V

HI Guys,

It is now possible (from 19.10 and higher) to use Regular Expressions in your SAP selectors.

Follow this guide to learn how!

See more documentation here:

Best regards, Lev

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.