Does useRecords still follow field options when loading a view?

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.

This topic was solved and automatically closed 15 days after the last reply. New replies are no longer allowed.