I am working on a batch macro where I want to use two fields as control parameters. I am wondering if that is possible?
Basically I want to use a table as input for control parameter, which has two fields.
1 | A |
2 | B |
I want to cross product the two fields as my control parameter.
1 | A |
1 | B |
2 | A |
2 | B |
I have created a combined field to use as the control parameter
1 | A | 1A |
1 | B | 1B |
2 | A | 2A |
2 | B | 2B |
Now I want to use the first two fields as control parameters to use them in two separate filters because its not desirable to create a combined field in the input data source for running the batch macro.
Can we do this?
Hi @Ashish
Yes, you can you pass two (or more) parameters in batch macro. To do this, in the macro, just insert as many 'control parameter' tools as the number of input parameters. In this case, whenever you will call the macro, it will ask you for the input streams for each parameter.
However, in this case, it takes the values of all the fields by row. So you may still have to create the Table 2 that you have mentioned in the question, i.e.
1 | A |
1 | B |
2 | A |
2 | B |
In case you take the original table, only two values will be passed to the macro -
1 | A |
2 | B |
By the way, you can get the Table 2 by simply using 'append fields' function.
Hi, @rohanonline, can you send the workflow, so that it will be easy to understand about the multiple control parameter concept or you can send me any link where workflow has been given using multiple control parameter.
I think the confusion here may be in that there are two questions:
1) Can you have more than one control parameter (sure!) - but make sure to label them. This is pretty straight forward - just use two control parameters to two action tools - to two filter tools. You have now mapped two fields in your batch macro.
2) Can you have more than one datastream going into the batch macro control parameter input - No. This can be fixed via an append data tool or other join in your main datstream so you can create your grid of values that you would expect for each batch macro run. You will then use the questions feature on the batch macro to map the correct field to each of the control parameters.