Customize Data File param with Page .Params

Hi, I would like to call different Site data File using page .Params.

I have data file like:

I can call it in type/single.html in partial like:

{{ $foo := $ }}
and range through it:
{{ range $foo }} {{ partial "photo-gallery" . }} {{ end }}

I would like to customize and call different data file depending on page .Params,
I figured out that I can customize it like:
in file:
myvalue: "filename"
and I can call it using:
{{ $foo := index $ Params.myvalue }}
and it works
but I would like to customize in page params category name too, like:
in file:
myvalue: "category/filename"

and try call it like:
{{ $foo := index $ Params.myvalue }}

how can I achieve it?
I’m beginner with hugo so I’d be grateful for help :slightly_smiling: