• Documentation
  • Workato Blog
  • Product Blog
  • Return to Workato
  • Login
  • Automation Institute
  • Documentation
  • Community Forums
New Topic
Discussions Recipe Building Formula Mode Questions
S

Saul Macht

started a topic over 5 years ago
Answered

Replace values using gsub, with pattern defined by string containing data pills

I'm using gsub to substitute values in my data pill, it does not work correctly. Nothing gets replaced even though there is a match. How can I substitute data in my data pills with some other values? 


This is my formula:


image


The "pattern" is being defined by data pills. When I switch the data pills to text, it works correctly. But I need the pattern to be dynamic



Best Answer
A
Amanda Wong said over 5 years ago

Hi Saul, if you're working with data pills as your pattern, the data pills will need to be enclosed within brackets. They should not be enclosed in quotes or // unlike in cases where you define a text pattern. 


Since the pattern is defined by a string containing 2 data pills separated by a period, you should try the following:


image





Answer

Amanda Wong

said over 5 years ago

Hi Saul, if you're working with data pills as your pattern, the data pills will need to be enclosed within brackets. They should not be enclosed in quotes or // unlike in cases where you define a text pattern. 


Since the pattern is defined by a string containing 2 data pills separated by a period, you should try the following:


image





Login to post a comment

Still can't find your solution?

Send us a ticket, we will try our best to assist you with your problem

Documentation
Developer's Library
Tutorials
eBooks
Product Hour
Product Blog
Workato Blog
Product updates
Customer Stories
© Workato 2022   Privacy   Terms   +1 (844) 469-6752
  • Documentation
  • Workato Blog
  • Product Blog
  • Solutions
  • Forums
  • Tickets
  • Log in
  • Return to Workato
Topic views count