Open KTHconsult opened 1 month ago
The logic normally used to iterate on entities is looping on the two top-level keys in the response: content
and status
.
The , "status":200
is what's causing the duplication, so you'll need to find a way to remove it.
You could use a script like this to strip the status from the response:
call_recipes:
alias: Call Recipes
sequence:
- action: script.recipes
response_variable: rest_response
- variables:
correct_reponse: >
{{ { "content" : rest_response["content"] } }}
- stop: All done
response_variable: correct_reponse
Im using the rest_command to get a json data array. Rest_command add this response to a dictionary where data as json is kept in the item called content alongside the item status that has the response status code. For easy reproduction i added a script with hardcoded result that shows the issue.
Flex Table Card configuration
Output from flex-table-card
Script that reproduces rest_command wrapping logic
Result from rest_command action
How can I configure the flex-table-card to only render 3 rows and thereby reflect the actual data result from the content section?