Solved

How can I call a variable in my dynamic table that's nested in my event data?

  • 28 June 2023
  • 4 replies
  • 107 views

Badge +3
  • Problem Solver I
  • 16 replies

I have tried to get this working both with dynamic tables and in it’s simplest form below, but it does not work the way I expect it to. Have gone through pretty much all the docs, so checking to see if anyone here can figure this out.

 

{% for item in event.sp_hours %}

{{ item }}: {{ item.check_in }} - {{ item.check_out }}

{% endfor %}

 

Currently I’m only having success with getting the day to display, but want it to loop through the days and list the hours. (yes, will get the day order fixed later).

For the dynamic table settings, Row collection is event.sp_hours and Row item is item, but same problem - only shows the day.

 

 

icon

Best answer by Taylor Tarpley 3 July 2023, 23:01

View original

4 replies

Userlevel 7
Badge +60

Hi @gmc

 

Thanks for sharing your question with us! 

 

Do you mind sharing what the overal goal you’re trying to accomplish in this dynamic table? Providing information can help me better find a solution here for you! 

 

Thanks for participating in the Community!

-Taylor 

Badge +3

Trying to display a set of check in and check out hours for each day, ie:

Monday 08:00 - 17:00
Tuesday 08:00 - 17:00

etc

Doesn’t seem like I can target the nested values (check in and check out), only the first level - the days.

Userlevel 7
Badge +60

Hi there @gmc

 

Thanks for the clarification! 

 

Even if the event data for the hours is nested, it’s still something that should be able to be pulled and displayed in a dynamic table. In my experience, issues like these are normally attributed to incorrect input of the variable from the event data into the table. I’d recommend taking a closer investigation of the ‘hours’ in your event data and confirm that there isn’t a missing or added space, letter or number according to our documentation here. 

 

Hope this helps!

-Taylor

Badge +3

This isn’t solved.

There are no missing or added spaces in the payload, and it “should” be able to be pulled, but I can’t find a way to target the nested values.

Most of the examples have the json looping through sequential numerical values {{ event.Items.0 }}, {{ event.Items.1 }}, ie 0, 1, 2, 3 etc, whereas I am trying to target day values - friday, monday, saturday and so on.

 

Reply