Post

2 followers Follow
0
Avatar

Issue with item->searchField

|

We're currently building an CSV import application which allows us to connect multiple items from another app, Excel import doesn't support this.

I'm wondering why item->searchField is giving issues. I'm trying to get the item_id by searching for a name in the Full Name (field_id 14494723) field in App Contacts (app_id 1903034).

Request

/item/field/14494723/find?limit=1&sort=created_on&text=Wayne+Gibbard

Response

{"error_propagate"=>false, "error_parameters"=>{}, "error_detail"=>nil, "error_description"=>"Only valid for fields of type 'app'", "error"=>"Only valid for fields of type 'app'"}

|

Thanks,

–Martijn 

Martijn Snels Answered

Please sign in to leave a comment.

9 comments

0
Avatar

Hi George, thanks for your answer. As we're moving forward we're bumping into the next problem while using item->get(). We're getting the following response from the API which totally doesn't make sense to me.

The app with id 1903034 does not have the right view on item with id 1903034

Martijn Snels 0 votes
Comment actions Permalink
0
Avatar

That error message usually means that you are using app authentication, and that you are trying to access an item that is not in the app you are authenticated as.

Casper Fabricius 0 votes
Comment actions Permalink
0
Avatar

Hi Casper, thanks for your quick reply.

We're using the app authentication. I think we're doing something wrong. I'm trying to search for the value which is in $data[0] and is in one of the items inside the app (1903034) on $fieldId_Contact (14494723).

$getContact = $api->item->get($appId, array('limit' => '1', 'remember' => 'false', 'sort_desc' => 'true', $fieldId_Contact => $data[0]));

Martijn Snels 0 votes
Comment actions Permalink
0
Avatar

Another quick check, to get and update items the App didn't create by itself we need to be authenticated as an user?

Martijn Snels 0 votes
Comment actions Permalink
0
Avatar

You can always get the item. Updating depends on the setting in the app builder (let other members edit...).

Christian Holm 0 votes
Comment actions Permalink
0
Avatar

You should use  $api->item->getItems instead of  $api->item->get. The latter only takes a specific item id and returns a single item.

For you second question, no, when authenticated as an app you can access all items in that app. The reason you get the error is that you supply the appId as the itemId, because you are using the wrong method.

Casper Fabricius 0 votes
Comment actions Permalink