Skip to main content

I am building my first workflow which, in part, pulls some values from a SQL DB to set field values in the list it is running on. One variable that I need to set is not found in a database, although it is in a SharePoint site separate from the one that runs my workflow.

1. Is it possible to query a list on a site that is not running my workflow?

2. Is it possible to query a list on a site in another farm on my domain?

If neither of these are possible, can the "Set variable" action contain if-else logic to help me set the right value to the variable? I don't see any indication of this in the inline function tab of the Insert Reference window.

My variable name contains a 2 digit numeric identifier at the right end which I can use to determine the database server that it resides on so ...

numericPart = Right(DBName,2) (maybe use substring here actually)

if (numericPart < 2)

    ServerName = 'ServerA'

else

ServerName= 'ServerB'

Seems pretty common task but I've yet to find out how so any help is appreciated.

both should be possible using query list action. but you will have to specify 'alternative' site and build whole CAML query on your own.

I've never tried it for remote farm, but if above doesn't work it still should be possible to use call web service action and invoke Lists.asmx web service on remote site

as you have noticed, there is not an IF() inline function, but there is set condition action that you can use.


Reply