Highlighted
Established Member.
131 views

How to alter a flow based on an IF statement, and then loop whole flow

Jump to solution

Hello, (version 2019.11)

I'm creating a script to read an excel sheet of userIDs, check SAP for the IDs, and if not found, it will delete the userID in the excel sheet, and then will check the next line. 

I can't figure out how to move back to the first step and read the next line. 
I also can't figure out how to get it to fail if the user isn't found in SAP, at the moment it's a success regardless if the user is found or not, as the process to search is a success.

Any help would be appreciated. Thanks

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

So, I come from the ADM side of the house. Everything you are trying to do is very, very easy in UFT. Now, this means launching and working in UFT, not the RPA Activity Recorder.

if-then-else - easy - using Edit->Code Snippit->if-then

verifying the user - easy - Standard Checkpoint

Moving through an Excel file -> Design->Step Generator-> Utility Objects->Data table - where you can get current row, set row, etc.

Just a thought.

View solution in original post

0 Likes
3 Replies
Highlighted
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

So, I come from the ADM side of the house. Everything you are trying to do is very, very easy in UFT. Now, this means launching and working in UFT, not the RPA Activity Recorder.

if-then-else - easy - using Edit->Code Snippit->if-then

verifying the user - easy - Standard Checkpoint

Moving through an Excel file -> Design->Step Generator-> Utility Objects->Data table - where you can get current row, set row, etc.

Just a thought.

View solution in original post

0 Likes
Highlighted
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

AFAIK you can do this in two phases:

  1. Read all the uids once from the excel by leaving the rowindex empty. Assign the uids to a variable.
  2. Create subflow that checks uids from SAP using a variable and deletes the cell if needed. Drag this to main flow, toglle subflow "Set as loop" on by rightclicking the subflow and use the uid list from step 1 as parameter for values.
0 Likes
Highlighted
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

...and what comes to detecting if user exists or not. 

Record the script with uid that doesnt exist. When you search the user you get error message in the status bar - use capture output functionality to record the error message.

Now when you run the recording uid that is not found will end up to success and existing fails because the status bar message is missing ie. you can delete the user if the flow execution succeeds.

Tags (1)
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.