Is It Possible to Have Optional $select or $expand in REST API Calls?

For example, if the url for the GET request is this:

url: domain.com/_api/web/lists/getbytitle('Thing')/items?$select=*,Something/Field1A&$expand=Something/Field1 

And if you're making multiple calls to grab different lists and one list happen to not have the Something field at all, instead of throwing an error and skipping over the whole request, is there a way to make these parameters optional? I have an array of lists that gets called one by one to retrieve their list items. There's a list that doesn't have that particular field so none of its items gets brought back. I'd like it where if that field doesn't exist, then it can just go ahead and get everything and not worry about it.

The reason I even have $select and $expand is because it's a lookup field and I need to get the user's name or else just the ID gets returned. Thanks.

Plus while writing this I wonder if using an if-else could work, but how would I know if the field exists before the request goes off.

Replay

Category: javascript Time: 2016-07-28 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.121 (s). 12 q(s)