Leth
Leth

Reputation: 1059

String concatenate functoid not returning mapped values to destination record

I have 3 index functoids which each receive a value from a specific record in the source schema. If there's a value in the first index, and there is not a value in the second index, then it should map the first index value. If the second index has a value, it should map that instead. enter image description here

The third index functoid should just map its value if it has one.

In my test file, the first index will return a value, since it is filled and the second is not, but my string concatenate functoid does not return anything to the destination schema, so the requried record is not being mapped.

I can't seem to understand why this behaviour occurs. The logic seems sound to me, and there should be a value in the string concatenate to map over.

Upvotes: 0

Views: 265

Answers (1)

Ruud
Ruud

Reputation: 1372

Value mappings will determine if output is generated at all, taking 'priority' over whatever comes after. If you debug your map you will see that Visual Studio creates two nested <xsl:if> statements around your concatenation, but since they will never both be true that code is unreachable.

An option is to replace your Value Mapping functoids with Scripting functoids and do something like this:

public string MyValueMapping(bool mapValue, string value)
{
  return (mapValue ? value : string.Empty);
}

Upvotes: 2

Related Questions