We have a process that we are building that will have a variable number of attachments in an email tool. There will be some emails going out with 5 attachments, some with none. What I'm trying to do is create a batch macro that takes the full input, as well as a control input with Invoice # and # of attachments, and using the # of attachments as the control parameter. I believe this is working properly.
The issue I'm having is when I get to the actions on the email tool. For my test, I've added 3 attachments to the Tool in the macro and am trying to say if the Control Parameter only = 2, then Make Attachment 1 and 2 = True and Attachment 3 = False, which I assumed would stop the tool from trying to send Attachment 3. I have 3 separate actions, each one referring to the Attachments>Attachment([name])>ValueIsField and highlighted the @value - value="True" line within the action tool. I then used the Formula ToNumber([#1])>=1, >=2. >=3 for the 3 attachments respectively.
I've tried a few different formulas as well, but every time I get 'Invalid Path: "3" in MakeCleanPath()' for my first record because there is only 2 attachments and it still appears to be trying to find the 3rd attachment. Has anyone had any success at dynamically adding, removing, or changing the number of attachments based on an action? I would like to make the default have 10 attachments and then set them to false using action tools if there is no data in the corresponding fields.
EDIT: After converting to a standard macro for testing, it appears the value I'm changing to false does not delete the attachment, but rather changes the checkbox that states whether you are using a field vs. browsing to a file in the setup. So, it is looking for a file path of '3' when it is successful at changing the value listed above. I don't believe it is possible to change whether or not there actually is an attachment using the Action tool at this time. Someone please tell me if I'm wrong.
Solved! Go to Solution.
I changed it Update Outer Xml, but I am still not seeing the attachments...