Skip to main content
Question

Contains statements within the SchemaMapper

  • December 16, 2021
  • 3 replies
  • 11 views

dustin
Influencer
Forum|alt.badge.img+31

It seems as though the SchemaMapper is setup for only If-Then statements. I'm wondering if there is perhaps a way to use the SchemaMapper by way of a Contains statement.

 

For example, if Attr1 contains 'xyz', make Attr2='123'. I don't believe this is possible, but was curious if anyone found a work-around to make it work.

3 replies

todd_davis
Influencer
Forum|alt.badge.img+23
  • Influencer
  • 313 replies
  • December 16, 2021

The contains is not available in Schemamapper as far as I know, but that doesn't mean you can't do it. You just need to work out if the contain is true before passing in into the schemamapper.

 

Just test Attr 1 for a contains 'xyz' and if it does, make Attr3 = 'xyz' and then schemamap Attr3 = 'xyz' to create Attr2='123'


dustin
Influencer
Forum|alt.badge.img+31
  • Author
  • Influencer
  • 629 replies
  • December 16, 2021

The contains is not available in Schemamapper as far as I know, but that doesn't mean you can't do it. You just need to work out if the contain is true before passing in into the schemamapper.

 

Just test Attr 1 for a contains 'xyz' and if it does, make Attr3 = 'xyz' and then schemamap Attr3 = 'xyz' to create Attr2='123'

Thanks. That's a good thought, but in my scenario I literally have hundreds of 'contains' instances, which would kind of defeat the purpose of using SchemaMapper afterward (why not just map it with conditionals in the AttributeCreator). It doesn't seem that far fetched to have this functionality built into the transformer....maybe this was better suited as a suggestion.


kailinatsafe
Safer
Forum|alt.badge.img+23
  • Safer
  • 720 replies
  • December 17, 2021

Hello @dustin​ , it doesn't look like this is offered by the SchemaMapper yet. I found an idea that you may want to upvote in the meantime! It would also be helpful if you could add a comment as to why you need the 'contains' operator present in the SchemaMapper. Sorry I don't have better news, Kailin.