user2436: I generate my datum like so:
// Build datum
const sellerAddressPKH = changeAddressValue.slice(2,58);
const datumFields = CSL.PlutusList.new();
datumFields.add(CSL.PlutusData.new_integer(CSL.BigInt.from_str( ... )));
const datumConstr = CSL.ConstrPlutusData.new(
    CSL.BigNum.from_str('0'),
    datumFields
);
const datum = CSL.PlutusData.new_constr_plutus_data(datumConstr);
const datumHash = CSL.hash_plutus_data(datum);

Part of the output where I am sending native asset into a smart contract, I am attaching the datum hash like so:
txBuilder.add_output(
    CSL.TransactionOutputBuilder
        .new()
        .with_address(scriptAddress)
        .with_data_hash(datumHash)
        .next()
        .with_asset_and_min_required_coin(
            multiAsset,
            CSL.BigNum.from_str(protocolParameters.costPerWord.toString())
        )
        .build()
);

This only appears to be attaching the datum hash, and I cannot easily see how you would attach the datum value with the above output.
Any ideas?

user5085: Yes, you're correct. When creating an output for a transaction, by default you only need to provide the datum hash. The consumer of that output is by default required to provide the datum that matches that hash.
If you want to provide the datum nonetheless for an output that you're creating in order to do assertions on it inside your spending validator you can do so like this:
const scripts = PlutusScripts.new();
scripts.add(PlutusScript.from_bytes(Buffer.from(<your script contract cborHex>, 'hex')));

const datumFields = CSL.PlutusList.new();
datumFields.add(CSL.PlutusData.new_integer(CSL.BigInt.from_str( ... )));
const datumConstr = CSL.ConstrPlutusData.new(
    CSL.BigNum.from_str('0'),
    datumFields
);
const datum = CSL.PlutusData.new_constr_plutus_data(datumConstr);

const transactionWitnessSet = CSL.TransactionWitnessSet.new();
transactionWitnessSet.set_plutus_scripts(scripts);
transactionWitnessSet.set_plutus_data(datum);
transactionWitnessSet.set_redeemers(...);

txBody.set_script_data_hash(hash_script_data(..., getCostModels(), datum));

{...}

export const COST_MODEL = [197209, 0, 1, 1, 396231, 621, 0, 1, 150000, 1000, 0, 1, 150000, 32, 2477736, 29175, 4, 29773, 100, 29773, 100, 29773, 100, 29773, 100, 29773, 100, 29773, 100, 100, 100, 29773, 100, 150000, 32, 150000, 32, 150000, 32, 150000, 1000, 0, 1, 150000, 32, 150000, 1000, 0, 8, 148000, 425507, 118, 0, 1, 1, 150000, 1000, 0, 8, 150000, 112536, 247, 1, 150000, 10000, 1, 136542, 1326, 1, 1000, 150000, 1000, 1, 150000, 32, 150000, 32, 150000, 32, 1, 1, 150000, 1, 150000, 4, 103599, 248, 1, 103599, 248, 1, 145276, 1366, 1, 179690, 497, 1, 150000, 32, 150000, 32, 150000, 32, 150000, 32, 150000, 32, 150000, 32, 148000, 425507, 118, 0, 1, 1, 61516, 11218, 0, 1, 150000, 32, 148000, 425507, 118, 0, 1, 1, 148000, 425507, 118, 0, 1, 1, 2477736, 29175, 4, 0, 82363, 4, 150000, 5000, 0, 1, 150000, 32, 197209, 0, 1, 1, 150000, 32, 150000, 32, 150000, 32, 150000, 32, 150000, 32, 150000, 32, 150000, 32, 3345831, 1, 1];
export const getCostModel = () => {
  const costModel = CostModel.new();
  COST_MODEL.forEach((x, i) => costModel.set(i, Int.new_i32(x)));
  const costModels = Costmdls.new();
  costModels.insert(Language.new_plutus_v1(), costModel);
  return costModels;
}


For more examples I recommend the following resources:
DApp Connector Examples
SpaceBudz Datum Creation

2436: <p>I generate my datum like so:</p>
<pre><code>// Build datum
const sellerAddressPKH = changeAddressValue.slice(2,58);
const datumFields = CSL.PlutusList.new();
datumFields.add(CSL.PlutusData.new_integer(CSL.BigInt.from_str( ... )));
const datumConstr = CSL.ConstrPlutusData.new(
    CSL.BigNum.from_str('0'),
    datumFields
);
const datum = CSL.PlutusData.new_constr_plutus_data(datumConstr);
const datumHash = CSL.hash_plutus_data(datum);
</code></pre>
<p>Part of the <code>output</code> where I am sending native asset into a smart contract, I am attaching the datum hash like so:</p>
<pre><code>txBuilder.add_output(
    CSL.TransactionOutputBuilder
        .new()
        .with_address(scriptAddress)
        .with_data_hash(datumHash)
        .next()
        .with_asset_and_min_required_coin(
            multiAsset,
            CSL.BigNum.from_str(protocolParameters.costPerWord.toString())
        )
        .build()
);
</code></pre>
<p>This only appears to be attaching the datum hash, and I cannot easily see how you would attach the datum <code>value</code> with the above output.</p>
<p>Any ideas?</p>
 5085: <p>Yes, you're correct. When creating an output for a transaction, by default you only need to provide the datum hash. The consumer of that output is by default required to provide the datum that matches that hash.</p>
<p>If you want to provide the datum nonetheless for an output that you're creating in order to do assertions on it inside your spending validator you can do so like this:</p>
<pre><code>const scripts = PlutusScripts.new();
scripts.add(PlutusScript.from_bytes(Buffer.from(&lt;your script contract cborHex&gt;, 'hex')));

const datumFields = CSL.PlutusList.new();
datumFields.add(CSL.PlutusData.new_integer(CSL.BigInt.from_str( ... )));
const datumConstr = CSL.ConstrPlutusData.new(
    CSL.BigNum.from_str('0'),
    datumFields
);
const datum = CSL.PlutusData.new_constr_plutus_data(datumConstr);

const transactionWitnessSet = CSL.TransactionWitnessSet.new();
transactionWitnessSet.set_plutus_scripts(scripts);
transactionWitnessSet.set_plutus_data(datum);
transactionWitnessSet.set_redeemers(...);

txBody.set_script_data_hash(hash_script_data(..., getCostModels(), datum));

{...}

export const COST_MODEL = [197209, 0, 1, 1, 396231, 621, 0, 1, 150000, 1000, 0, 1, 150000, 32, 2477736, 29175, 4, 29773, 100, 29773, 100, 29773, 100, 29773, 100, 29773, 100, 29773, 100, 100, 100, 29773, 100, 150000, 32, 150000, 32, 150000, 32, 150000, 1000, 0, 1, 150000, 32, 150000, 1000, 0, 8, 148000, 425507, 118, 0, 1, 1, 150000, 1000, 0, 8, 150000, 112536, 247, 1, 150000, 10000, 1, 136542, 1326, 1, 1000, 150000, 1000, 1, 150000, 32, 150000, 32, 150000, 32, 1, 1, 150000, 1, 150000, 4, 103599, 248, 1, 103599, 248, 1, 145276, 1366, 1, 179690, 497, 1, 150000, 32, 150000, 32, 150000, 32, 150000, 32, 150000, 32, 150000, 32, 148000, 425507, 118, 0, 1, 1, 61516, 11218, 0, 1, 150000, 32, 148000, 425507, 118, 0, 1, 1, 148000, 425507, 118, 0, 1, 1, 2477736, 29175, 4, 0, 82363, 4, 150000, 5000, 0, 1, 150000, 32, 197209, 0, 1, 1, 150000, 32, 150000, 32, 150000, 32, 150000, 32, 150000, 32, 150000, 32, 150000, 32, 3345831, 1, 1];
export const getCostModel = () =&gt; {
  const costModel = CostModel.new();
  COST_MODEL.forEach((x, i) =&gt; costModel.set(i, Int.new_i32(x)));
  const costModels = Costmdls.new();
  costModels.insert(Language.new_plutus_v1(), costModel);
  return costModels;
}

</code></pre>
<p>For more examples I recommend the following resources:</p>
<p><a href="https://github.com/dynamicstrategies/cardano-wallet-connector/blob/master/src/App.js" rel="nofollow noreferrer">DApp Connector Examples</a></p>
<p><a href="https://github.com/SpaceBudz/spacebudz/blob/c5571863c4c8b370033ee72969c95d931d2fba6b/src/cardano/market/index.js#L985" rel="nofollow noreferrer">SpaceBudz Datum Creation</a></p>
