user1108: I currently have a utxo that i am getting like this.
initalMatchPool <- Map.filter (findInitalAmount fundAddress) <$> utxosAt scrAddress

How do i get the value of the datum attached to this specific utxo ?

user5085: OffChain:
It's a datum hash - so there is no reverse lookup if you don't know how to construct datums for a given contract.
Datum values are usually provided by the consumer of a script UTxO.
OnChain:
If this is onchain code (which it does not look like), you can use a function called findDatum to lookup datums provided by the consumer of a script UTxO.

user5801: The ChainIndexTxOut type has a data field called _ciTxOutValue :: Value and another that is _ciTxOutDatum :: Either DatumHash Datum I'll show you how to get the value. Getting the datum is the same process with the extra step of having to extract it from the Either binding.
utxos <- utxosAt ...
list = Map.toList utxos
firstUtxo = head list
ci = snd firstUtxo
val = _ciTxOutVale ci

utxos is type Map(TxOutRef ChainIndexTxOut)
list is type [(TxOutRef, ChainIndexTxOut)]
firstUtxo is type (TxOutRef, ChainIndexTxOut)
ci is type ChainIndexTxOut
val is type Value
All those lines can be combined to vals = _ciTxOutValue (snd (head (Map.toList utxos))) or if you want the sum of all the of the values instead of just the value in the first utxo at the address, you can do vals = _ciTxOutValue <$> (snd <$> Map.toList utxos)

user2335: The upshot is that you might not find a datum, but instead get a hash of the datum (it depends).
When submitting a transaction, the full "unhashed" datum is not automatically attached to the output. This to save space and add use cased where the sender wants to keep the datum a secret. If it is not attached, you will not find it onchain, only the hash of the datum used. Reversing this is (computational) impossible by construction.
In the other case, where there is one attached, you can retrieve it. As stated by Kyle Murphy the constructor ChainIndexTxOut(1) that resulted from the filter "findInitalAmount fundAddress" over all UTxO's sitting at the script address scrAddress contains all info known of these outputs fitting the condition you specified.
The function utxosAt returns a map of two fields, Map TxOutRef ChainIndexTxOut (2). Each TxOutRef contains the hash of the transaction that made this utxo and an associated id relative to the other outputs of that transaction (TxOutRef TxId Integer). Now the other field in the Map is the ChainIndexTxOut which can contain one of two things depending on the query. If you queried a script address, this will be

Note That the _ciTxOutDatum constructor holds a Either DatumHash Datum. So if the UTxO contains a datum you can retrieve, you can extract it with Right like below.
getDatum :: ChainIndexTxOut -> Maybe Datum
getDatum o = case _ciTxOutDatum o of
            Right  i               -> Just i 
            Left   j               -> Nothing

I hope this helps.

1108: <p>I currently have a utxo that i am getting like this.</p>
<pre><code>initalMatchPool &lt;- Map.filter (findInitalAmount fundAddress) &lt;$&gt; utxosAt scrAddress
</code></pre>
<p>How do i get the value of the datum attached to this specific utxo ?</p>
 5085: <p>OffChain:
It's a datum hash - so there is no reverse lookup if you don't know how to construct datums for a given contract.
Datum values are usually provided by the consumer of a script UTxO.</p>
<p>OnChain:
If this is onchain code (which it does not look like), you can use a function called <code>findDatum</code> to lookup datums provided by the consumer of a script UTxO.</p>
 5801: <p>The ChainIndexTxOut type has a data field called <code>_ciTxOutValue :: Value</code> and another that is <code>_ciTxOutDatum :: Either DatumHash Datum</code> I'll show you how to get the value. Getting the datum is the same process with the extra step of having to extract it from the Either binding.</p>
<pre><code>utxos &lt;- utxosAt ...
list = Map.toList utxos
firstUtxo = head list
ci = snd firstUtxo
val = _ciTxOutVale ci
</code></pre>
<p>utxos is type Map(TxOutRef ChainIndexTxOut)</p>
<p>list is type [(TxOutRef, ChainIndexTxOut)]</p>
<p>firstUtxo is type (TxOutRef, ChainIndexTxOut)</p>
<p>ci is type ChainIndexTxOut</p>
<p>val is type Value</p>
<p>All those lines can be combined to <code>vals = _ciTxOutValue (snd (head (Map.toList utxos)))</code> or if you want the sum of all the of the values instead of just the value in the first utxo at the address, you can do <code>vals = _ciTxOutValue &lt;$&gt; (snd &lt;$&gt; Map.toList utxos)</code></p>
 2335: <p>The upshot is that you might not find a datum, but instead get a hash of the datum (it depends).</p>
<p>When submitting a transaction, the full &quot;unhashed&quot; datum is not automatically attached to the output. This to save space and add use cased where the sender wants to keep the datum a secret. If it is not attached, you will not find it onchain, only the hash of the datum used. Reversing this is (computational) impossible by construction.</p>
<p>In the other case, where there is one attached, you can retrieve it. As stated by Kyle Murphy the constructor <code>ChainIndexTxOut</code><a href="https://playground.plutus.iohkdev.io/doc/haddock/plutus-ledger/html/Ledger.html#t:ChainIndexTxOut" rel="nofollow noreferrer">(1)</a> that resulted from the filter &quot;<code>findInitalAmount fundAddress</code>&quot; over all UTxO's sitting at the script address <code>scrAddress</code> contains all info known of these outputs fitting the condition you specified.</p>
<p>The function <code>utxosAt</code> returns a map of two fields, <code>Map TxOutRef ChainIndexTxOut</code> <a href="https://playground.plutus.iohkdev.io/doc/haddock/playground-common/html/Playground-Contract.html#v:utxosAt" rel="nofollow noreferrer">(2)</a>. Each <code>TxOutRef</code> contains the hash of the transaction that made this utxo and an associated id relative to the other outputs of that transaction (<code>TxOutRef TxId Integer</code>). Now the other field in the <code>Map</code> is the <code>ChainIndexTxOut</code> which can contain one of two things depending on the query. If you queried a script address, this will be
<a href="https://i.stack.imgur.com/41nuk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/41nuk.png" alt="enter image description here" /></a></p>
<p>Note That the <code>_ciTxOutDatum</code> constructor holds a <code>Either DatumHash Datum</code>. So if the UTxO contains a datum you can retrieve, you can extract it with <code>Right</code> like below.</p>
<pre><code>getDatum :: ChainIndexTxOut -&gt; Maybe Datum
getDatum o = case _ciTxOutDatum o of
            Right  i               -&gt; Just i 
            Left   j               -&gt; Nothing
</code></pre>
<p>I hope this helps.</p>
