# Passing query property from matchmaking to the match create module

**URL:** <https://forum.heroiclabs.com/t/passing-query-property-from-matchmaking-to-the-match-create-module/4005>\
**Category:** Runtime Framework\
**Tags:** lua\
**Created:** [July 3, 2023, 7:54pm UTC](https://forum.heroiclabs.com/t/passing-query-property-from-matchmaking-to-the-match-create-module/4005 "2023-07-03T19:54:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![M.Alatal](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@M.Alatal](https://forum.heroiclabs.com/u/M.Alatal)\
**Post date:** [July 3, 2023, 7:54pm UTC](https://forum.heroiclabs.com/t/passing-query-property-from-matchmaking-to-the-match-create-module/4005/1 "2023-07-03T19:54:22Z")

</div>

My game using matchmaking to match players together pased on their highest map they unlocked using a query proparaty called top\_map

After the matchmaking find enough players it generate a match using this lua module

local nk = require(“nakama”)

local function makematch(context, matched\_users)  
local top\_map = context. query\_params[“top\_map”]

local modulename = “world\_control”  
local setupstate = { invited = matched\_users, top\_map = top\_map }  
local matchid = nk.match\_create(modulename, setupstate)

return matchid  
end

nk.register\_matchmaker\_matched(makematch)

In my world\_control module i tried to get the top\_map from the sent data in the match\_init and pass it to the game state like this:

function world\_control.match\_init(context, setupstate)  
Local gamestate = {  
map = setupstate. top\_map

}  
.  
.  
.

But when i use state.map later in the code it still nil i dont know whats i am doing wrong

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [July 6, 2023, 1:30pm UTC](https://forum.heroiclabs.com/t/passing-query-property-from-matchmaking-to-the-match-create-module/4005/2 "2023-07-06T13:30:19Z")

</div>

Hello @M.Alatal,

The `context` of the `makematch` function will not contain query params because the registered function is not tied to an http request, the `query_params` is only present in the `context` for functions registered for RPC calls.

However you can access any `properties` that you set when [submitting the ticket](https://heroiclabs.com/docs/nakama/concepts/multiplayer/matchmaker/#properties), you can access them like [this](https://github.com/heroiclabs/nakama/blob/master/data/modules/match_init.lua#L53).

Hope this helps.

---

<div class="post-metadata">

**Author:** ![M.Alatal](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@M.Alatal](https://forum.heroiclabs.com/u/M.Alatal)\
**Post date:** [July 7, 2023, 10:56am UTC](https://forum.heroiclabs.com/t/passing-query-property-from-matchmaking-to-the-match-create-module/4005/3 "2023-07-07T10:56:06Z")

</div>

Thank you for the help
