user5273: Datum is hashed and assigned to an UTXO
When you send the transaction you can add optional parameters like metadata and/or datum
datum is used by smart contract since it's the only data that smart contract can see.
So in short:

Send the transaction to the address
Add json to metadata
Convert the json to datum and add to UTXO

how to implement "Convert the json to datum and add to UTXO" using NAMI wallet.

user5412: Be careful not to confuse metadata and datum, as they are different things. Metadata are part of a transaction, while a datum is part of an UtxO.
Metadata are completely optional and to the discretion of the transaction issuer, while the datum is mandatory when dealing with script addresses.
Some metadata can optionally be attached to a transaction independently of your decision to add some datum to the different UtxO. In addition, you don't send the datum directly, but its hash.
It is only when you want an UtxO back from a script that you have to provide a datum whose hash has to match with the one you defined previously.
This datum will then be part of the script context, as long a additional data you can provide through redeemers.
So, you can indeed record the datum intended for the script in the transaction metadata, but it not mandatory. It is just a mechanism to recover the correct information in case it is not possible otherwise.
Now, for the "how to do that ?", the best is to study some open source code, like the one for the SpaceBudz market. It heavily uses the serialization lib to provide the different information required by this wallet.

5273: <p>Datum is hashed and assigned to an UTXO</p>
<p>When you send the transaction you can add optional parameters like metadata and/or datum
datum is used by smart contract since it's the only data that smart contract can see.</p>
<p>So in short:</p>
<ol>
<li>Send the transaction to the address</li>
<li>Add json to metadata</li>
<li>Convert the json to datum and add to UTXO</li>
</ol>
<p>how to implement &quot;Convert the json to datum and add to UTXO&quot; using NAMI wallet.</p>
 5412: <p>Be careful not to confuse metadata and datum, as they are different things. Metadata are part of a transaction, while a datum is part of an UtxO.</p>
<p>Metadata are completely optional and to the discretion of the transaction issuer, while the datum is mandatory when dealing with script addresses.</p>
<p>Some metadata can optionally be attached to a transaction independently of your decision to add some datum to the different UtxO. In addition, you don't send the datum directly, but its hash.</p>
<p>It is only when you want an UtxO back from a script that you have to provide a datum whose hash has to match with the one you defined previously.</p>
<p>This datum will then be part of the script context, as long a additional data you can provide through redeemers.</p>
<p>So, you can indeed record the datum intended for the script in the transaction metadata, but it not mandatory. It is just a mechanism to recover the correct information in case it is not possible otherwise.</p>
<p>Now, for the &quot;how to do that ?&quot;, the best is to study some open source code, like the one for the <a href="https://github.com/Berry-Pool/spacebudz/blob/3c1700b686677f9f87a5f8c78d3eb9029774dd32/src/cardano/market/index.js#L397-L436" rel="nofollow noreferrer">SpaceBudz market</a>. It heavily uses the <a href="https://github.com/Emurgo/cardano-serialization-lib" rel="nofollow noreferrer">serialization lib</a> to provide the different information required by this wallet.</p>
