# Return a \`List\` of metrics from client to server

**URL:** <https://discuss.flower.ai/t/return-a-list-of-metrics-from-client-to-server/1070>\
**Category:** Flower Help - Beginners\
**Tags:** flower\
**Created:** [August 5, 2025, 3:55pm UTC](https://discuss.flower.ai/t/return-a-list-of-metrics-from-client-to-server/1070 "2025-08-05T15:55:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chongshenng](https://dub1.discourse-cdn.com/flex013/user_avatar/discuss.flower.ai/chongshenng/32/153_2.png) [@chongshenng](https://discuss.flower.ai/u/chongshenng)\
**Post date:** [August 5, 2025, 3:55pm UTC](https://discuss.flower.ai/t/return-a-list-of-metrics-from-client-to-server/1070/1 "2025-08-05T15:55:23Z")

</div>

> [@](#):
>
> [**View in #questions on Slack**](https://slack.com/archives/C01RM6LMKQA/p1753809259513379)
> 
> ![Osama_Abu_Hamdan](https://europe1.discourse-cdn.com/flex013/uploads/flower/original/1X/453cf8ec2f104f0fd3bf22efe46f409ba6103d55.png) **@Osama\_Abu\_Hamdan:** Hello,  
> I am trying to return a List[int|float] of collected metrics from a client to the server when get\_properties is called.  
> I get this error
> 
> ```auto
> TypeError: There is not a 1:1 mapping between `common.Scalar` types and those supported in `common.ConfigRecordValues` or `common.ConfigRecordValues`. Consider casting your values to a type supported by the `common.RecordDict` infrastructure. You used type: <class 'list'>
> 
> ```
> 
> I checked the code and it only accepts scalars to be in return values. Any other way to pass metrics from client to server?  
> Best
> 
> ![Chong_Shen](https://europe1.discourse-cdn.com/flex013/uploads/flower/original/1X/35ad3d046e9b5591f46842633a53d2d629f7ec99.png) **@Chong\_Shen:** @Javier Can you please help with this question?
> 
> ![Javier](https://europe1.discourse-cdn.com/flex013/uploads/flower/original/1X/1f9b0deef304eac18d3fcd472fbb1ab3a058707e.jpeg) **@Javier:** Hi @Osama\_Abu\_Hamdan, returing a list is not supported. Only those types of type [Scalar](https://github.com/adap/flower/blob/28e2ce292dedd8fb583859465099939d8a1872c1/framework/py/flwr/common/typing.py#L34) are supported. If you want to communicate a list I’d recommend you serialize it as a JSON for instance. Like this:
> 
> ```auto
> import json
> 
> def get_properties(self, config):
> # Original list of integers
> original_list = [1, 2, 3, 4, 5]
> 
> # Serialize to string
> json_string = json.dumps(original_list)
> 
> return {'my_property': json_string}
> 
> ```
> 
> Then, on the receiving end (likely in your strategy) you just need to deserialize it:
> 
> ```auto
> # Deserialize back to list
> restored_list = json.loads(json_string)
> 
> ```
> 
> I hope this helps!!!

Reposted from Slack
