How can we create a list based on several Data sheets


#1

Hi Antti. New challenge I’m facing; How can we create a list based on several data sheets? Is there any example of how to achieve this? In my case the items will be listed by date regardless of which datasheet/fields are presented in the list. Should I use states or simple using a script in the field in React Studio? There are different types of posts which one with their data Sheet. Therefore in this list, there are simple posts, polls, a new recommendation or a new review. All them listed in this feed. Best, Marcos


#2

Hi,

List can have only one data sheet as data source. You need to edit the backend so that it returns one Data sheet with all needed columns. If you are trying to create feed which has many post types then you need to add component inside list item component and change that component’s state based on the post type (e.g. image, text, video etc.).

I’ll make a quick example about this later.


#3

Hey Antti. Makes sense. I took this path yesterday rebuilding the component to turn it based on states. So, depending on what you want to post, a different form will show up. The problem is that each one has its collection, how to do this. Leaving all inside the same collection would be a mess. Looking forward to see you exemple. Thank you


#4

Hi, i think this is a matter of Backend design. You can add each row into different collection but the Feed must contain all posts in one Data sheet if you’re planning to use React Studio’s list element.

Here’s an example: https://neonto.cloud/preview/gzedp55w

In the example I’ve nested component into List item component and I change its state based on the row type (image, status, video).


#5

Hey Antti. Yes, I see and It’s great for posts. I already doing this using states on the row type when it has a photo upload by the user. However, I was considering this was possible based on what you said in this thread - How to access datasheets from javascript functions (about creating the list based on several Data sheets. )

best, Marcos


#6

In that post I meant that it’s probably possible to create list based on many data sheets but it would require huge script hack and wouldn’t make any sense. Even in this case you’d need one Data sheet which is used as data source for the list element. This data sheet would be filled in script based on other Data sheets.

You should create the feed in backend and load it into one Data sheet in studio.