# Getting variable values in PowerModels.jl

**URL:** <https://discourse.julialang.org/t/getting-variable-values-in-powermodels-jl/15192>\
**Category:** Optimization (Mathematical)\
**Created:** [September 19, 2018, 6:43pm UTC](https://discourse.julialang.org/t/getting-variable-values-in-powermodels-jl/15192 "2018-09-19T18:43:37Z")\
**Posts on this page:** 1\
**Page:** 2

<div class="post-metadata">

**Author:** ![ccoffrin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ccoffrin/32/400_2.png) [@ccoffrin](https://discourse.julialang.org/u/ccoffrin)\
**Post date:** [September 26, 2018, 11:39pm UTC](https://discourse.julialang.org/t/getting-variable-values-in-powermodels-jl/15192/21 "2018-09-26T23:39:48Z")

</div>

I think the issue you have is that that branch index in “case[“branch”]” is a string, not an int. Try something like this,

```julia
bpp= Dict( (branch["f_bus"] , branch["t_bus"]) => w[(parse(Int,i)] for (i,branch) in case["branch"]) 

```

[Previous page](https://discourse.julialang.org/t/getting-variable-values-in-powermodels-jl/15192.md?page=1)
