Hi there,
So our company has a use case where they need to replace certain parts of a letter with customer information coming from a different file. My first thought was to create a batch macro where it will comb through the message coming in for the pieces of text it needs to replace with the other data. I thought it would be a pretty simple IF statement that I could use in the Action tool that connects the Control Parameter and the Report Text. But I can't figure out how to get that formula to work with the tool.
Attached are screenshots of an example of the message that I'm pushing through the Report Text tool, the highlighted sections are what I'm looking to replace and those all match the field names from the other data set. I've also attached screenshots of how I have the Report Text and Action Tool configured. Below is the formula that I'm using:
IF Contains([Field_1:A], "[Customer NAME]") THEN Replace([Field_1:A],"[Customer NAME]",[Customer Name]) ELSE [Field_1:A] ENDIF
I've also attached the workflow, but there's really nothing to it other than the inputs, report text, and the macro tools.
If anyone could help with what I need to do to get that to work that would be great! Or if there's something else you'd recommend doing that would be more efficient - note I don't have Python or R language knowledge so I won't really be able to leverage those tools on my own.
Thank you!
Solved! Go to Solution.
Can you resolve your formula variables in a formula tool before the report text tool? So you create a field called something like "final_customer_name" in a formula tool where you use your "if contains(f1,[customer name]) then [Customer NAME] else [Customer Name] endif or whatever.
that way, when you go into the report text tool, you can just use [Field:Final_customer_name] and not have to try to rig a formula IN the report text tool itself.
@dmpope
If I understand your intention here correctly, maybe we can do as below.
We will feed the customer information as control parameter to the batch macro, where we will the reporting with Reporting Text tool
@Qiu This is perfect, thank you so much!
@dmpope
Glad to be any help.