hi,
I am trying to create a BOT that will read records from Appian DB, hit a website, extract information (get attributes) and update few other columns of the DB.
The table is
The BOT reads restaurantname (in a loop), get attributes (status and date) and update the DB back
this is what I have
Loop is: foreach pv!restaurant.restaurantName
Update value in search is "interact with element" with value as fv!item
Get Date is 'get attribute' with target as restaurant.inspectionDate where restaurant is a variable of type CDT that has
when i run this BOT (through a process model) I see the restaurant names are picked up fine by the loop (one after another),
however the status and date values that gets updated is for the last entry in the table (in this case: Gallery Market & Cafe)
so when I see the process variable in BOT after it has run it is
Discussion posts and replies are publicly visible
Hello,
In your "Get Attribute" actions for "Get Status" and "Get Date", you need to specify the index of the CDT that is within the loop in the target field. For example, save into restaurant[fv!index].inspectionDate. The same issue will occur on the status.
Hi Cyrus,
I do not have the 'edit as expression' link for the target field. just the dropdowns available
One other option was to create a temporary pv! variable - itemStatus and itemInspectionDate and then use the 'Evaluate Expression'
Inside the loop
Step 1:use get attribute to move the values to ItemStatus and itemInspectionDate like
Step 2: Use evaluate expression at the end of the loop ..
a!update(pv!restaurant, fv!index, 'type!{urn:com:appian:types:RD}RD_ddrestaurantstosearch'(restaurantName: fv!item, restaurantStatus: pv!itemStatus, inspectionDate: pv!itemInspectionDate))
but looks like I need to work on the expression. It is not populating anything
Any suggestions ??
thanks
jaideep
Hi Jaideep,
With what you have, try appending the constructed CDT into pv!restaurant.
In RPA outputs for the evaluate expression select "Is appended to" the target pv restaurant.
In the expression itself, only have the constructor piece:'type!{urn:com:appian:types:RD}RD_ddrestaurantstosearch'(restaurantName: fv!item, restaurantStatus: pv!itemStatus, inspectionDate: pv!itemInspectionDate))
Hi Cyrus, yes, but this is creating additional 2 more rows in the DB (while using appended) - though the status and date values are correct in the 2 new rows.
and 1 additional row (last row) when using (stored as)
both appended and stored as is adding more rows to the DB but what I need is to update the existing rows of the DB
regards