Help

Does useRecords still follow field options when loading a view?

Topic Labels: Custom Extensions
477 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Bryn_Humble
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi,

I am using the useRecords hook extensively in my application, and cannot find an answer in the documentation to this question.

The useRecords documentation shows an example of using field options to limit the amount of data loaded from a table like so:

// Returns all records in a table, only loading data for the specified fields
     records = useRecords(table, {fields: ['My field']});

This appears to work, however I am trying to use it with a view like so

     records = useRecords(view, {fields: ['My field']});

Based on my testing, when used with a view useRecords ignores the fields argument and loads all fields for the records in the view anyway.

Can anyone confirm if this is the case, and if so, is there an alternative method to achieve my goal? I need to evaluate one field in the view, so loading the whole view is a waste. I would prefer not to use the table as we are using the view filters to keep logic out of the code.

Thanks,

Peter Toft.

0 Replies 0