- Posts: 27
Field (of the input) to use as parameter for the output
- Gennaro
- Topic Author
- Offline
- User
Less
More
12 years 9 months ago #2216
by Gennaro
Field (of the input) to use as parameter for the output - Post(2216) was created by Gennaro
Hi (again),
I'm trying to use a field (which is present once in the read side) as parameter to be saved on each record of the write side.
I'm trying the GET/SET parameter with no luck...
any suggestions?
thanks again
P.S. please see the example attached, I'd like to replicate the field 'notes' of the read side to each row of the write side.
I'm trying to use a field (which is present once in the read side) as parameter to be saved on each record of the write side.
I'm trying the GET/SET parameter with no luck...
any suggestions?
thanks again
P.S. please see the example attached, I'd like to replicate the field 'notes' of the read side to each row of the write side.
Attachment example.zip not found
Attachments:
Please Log in or Create an account to join the conversation.
- FlowHeater-Team
- Offline
- Admin
12 years 9 months ago #2217
by FlowHeater-Team
Best wishes
Robert Stark
Replied by FlowHeater-Team on topic Re:Field (of the input) to use as parameter for the output - Post(2217)
Hi Gennaro,
To set a parameter only on first row you have to use the following little script.
Note: In the .NET Script Heater you have to switch the "Execute when" option to "Per each Row"
In the attachment you can find a brief example how to use it.
In one of a next version I’ll put this feature into the Set Parameter Heater, thanks for the request.
To set a parameter only on first row you have to use the following little script.
Code:
int count = 0;
public object DoWork()
{
if (InValues.Length == 0)
throw new Exception("one input parameter expected");
// only set the parameter on first row
if (count == 0)
Parameter.SetValue("first_number", InValues[0].GetValue());
count++;
return null;
}
Note: In the .NET Script Heater you have to switch the "Execute when" option to "Per each Row"
In the attachment you can find a brief example how to use it.
In one of a next version I’ll put this feature into the Set Parameter Heater, thanks for the request.
Attachment set_parameter_only_on_first_row.zip not found
Best wishes
Robert Stark
Attachments:
Please Log in or Create an account to join the conversation.
Time to create page: 0.252 seconds