I wanted to update record field with fv!index.
I have
Recrod type
filed1,
field2,
field3
field3 should update with foreach index
Discussion posts and replies are publicly visible
I do not understand what you want to achieve. Please describe in more detail.
If you're looping through records using a foreach, you can use an index to update field3 like this:
foreach
int index = 0; foreach (var record in records) { record.field3 = index; index++; }
This way, field3 will hold the index value for each record. Let me know if you're using a different language or structure cuz i told you what i understood
This way, field3 will hold the index value for each record.
Do you want to update records in a record type where field3 should contain each record's position/index in the list?
Hi ak0642 ,if you are referring to update a single field of a record type in a!foreach() using fv!index,this could be possible.You need to write saveInto to rule input inorder to pass data from interface to PM if using action.
a!localVariables( local!data: index( rule!HDS_getRequestData(returnData: true()), /*use your rule*/ enumerate(5) + 1 ), a!forEach( items: { 1, 2, 3, 4, 5 }, expression: a!update( local!data, recordtype!HDS Request.assetId, /*use field*/ fv!index ) ) )