I need to access user_id from project_permissions map and save it in variable

I need to access user_id which I cannot access. How do I get the value user_id from the the map?

project_permissions =>: %{
“check” => “true”,
“message” => “sdasdasadadsnlknasdklnadskl”,
“project_permission_id” => “1”,
“user_id” => “2”
}

:wave:

iex> project_permissions = %{
  "check" => "true",
  "message" => "sdasdasadadsnlknasdklnadskl",
  "project_permission_id" => "1",
  "user_id" => "2"
}

# https://hexdocs.pm/elixir/Map.html#get/3
iex> user_id = Map.get(project_permissions, "user_id")
"2"

Ok got it

Hello @bilalhassankh,

Please use triple ` to wrap your code, as @ruslandoga did. It will be more readable.