Skip to content


Conditional Logic

Scott Frager asked 2 years ago
New to SC…  Attempting to set up an integration where, I look up a target record (e.g. CRM Product) and change the behavior of my SC map based on whether I find a record or not.  I’m not intuitively seeing a way to do this.
Any direction (documentation) to help me figure this out is greatly appreciated!
Patrick Roth Staff answered 2 years ago
No, there isn’t a way to change how SC processes the records based on a lookup.  The reason is that the “lookup” results do not have visibility outside of mapping the field directly.
So we can have a calculation that inspects that value and then does anything like:
  do this
  do that
end if
The only thing you COULD do along these lines is instead of using a single source map you would use a multi-datasource map.
So one source is the existing source.  And then the other would be a query on the “lookup” you are using – so CRM Product in your reference.  Then you join both of these together however you need it to be – so probably the field.
Now when you preview the data, you would have the joined data available for the results.
Then in your code, you can then reference the product data.  If a field doesn’t exist, then product.MYFIELD = “” since the join failed.
Or whatever you need.
But that would be about the only way you could do this.
Scott Frager replied 2 years ago

Thanks Patrick! I like the idea of multi-datasources and want to explore further. While I have found documentation (on-prem?) on how to set this up (link below), I am not seeing a way to set that up in SC Online. Is there a setup/configuration item needed to expose that? Or, perhaps its right under my nose and I’m not seeing it? (attempted to add a screen shot, but this forum doesn’t see to allow that.)

Another example of what I’m trying to do is move a records from Source to Target, then circle back and to Source to update a foreign key from Target. Not sure if a multi-datasource would help me this scenario?,1.

Patrick Roth Staff replied 2 years ago

No, currently multi-datasource is only available onprem.

And for the scenario of source->target and then target->source, multi-datasource doesn’t help there.

For that you would need to run a 2nd map then querying that target data and then sending it back to the original source. The trick is knowing which data to query. You’d have to know which records to query – maybe use a filter of “created data” I the last 10 minutes (or modified date) and run that as a crm query as the source and whatever back to the dest.

Ren replied 1 year ago

In relation to this multi source where one source is a file and another is a query to a database, I have a query: How does SC behave if the query is being done to a table that is populated during the integration?
Say I am trying to access data integrated by my current map to table 1 (this occurs during the integration at node 2 of the import) so I can use it as the source data for node 3 of same import? Reason I am trying to query the table is because the data is auto populated by the integration and does not form part of the user populated source data.
So I guess my question is really – does the source query made in multi-datasource at the start of the integration see the data that existed at the start of the import alone or does it see data in the source query real time and as such if data is added to the original query during the integration, the query reflects this new data?

If you would like to submit an answer or comment, please sign in to the eOne portal.