Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Field 'recordName' is not marked queryable - cloudkit dashboard

In Cloudkit Dashboard, I select Record Type, Edit Indexes, then I select Add Basic Index. I see in the dropdown createTime, createdBy, eTag, modTime, modifiedBy, recordID and the record fields. I do not see recordName in the dropdown( Attached screenshot). Without creating index on recordName, I cannot query the record in cloudKit Dashboard. I get error: Field 'recordName' is not marked queryable How to create index on recordName? screen shot of crete index

like image 931
vrao Avatar asked Oct 18 '21 02:10

vrao


2 Answers

I ran into this same issue and solved it by adding ___recordID as a queryable index. When it is added to the list of indexes, the field changes to recordName.

To add this as a queryable index, go to the Schema Section -> Indexes, and click Add Basic Index.

like image 183
kschins Avatar answered Oct 17 '22 09:10

kschins


Here is a visual of how to do it in the dashboard. Pay attention to the photos with steps 8) and 18).

FYI after doing the below I ran into another issue where I got an error

Field 'createdBy' is not marked queryable

I'm not sure which one is createdBy but to fix it I had to follow the same exact steps below except on step 14), I choose createdUserRecordName and all the other system generated field names like __etag etc and then had to make sure each one was 15 )queryable. I had to press 16) Save Changes for each one separately.

A- Select 1) Databases > 2) click the dropdown arrow 3) select your iCloud name from 4) Xcode

enter image description here

enter image description here

B- Next select 5) Record (press the drop down arrow) > 6) Schema > Record Types (after Record Types highlights click anywhere off of the screen)

enter image description here

enter image description here

C- Next under 7) Record Type click Users or whatever the name of your record type is

enter image description here

D- On the next screen you will will see 8) the recordName field is set to None under Single Field Indexes. To change it and fix the issue press 9) Record Types to go back

enter image description here

E- After you went back a page, on that same page 10) press the down arrow next to Records > then 11) select Schema > Indexes (after Indexes highlights click anywhere off of the screen)

enter image description here

enter image description here

F- Next under 12) Record Type click Users or whatever the name of your record type is

enter image description here

G- On this page, at the bottom, 13) click Add Basic Index and then select 14) recordName

enter image description here

enter image description here

H- On that same page, make sure that 15) the Index Type is Queryable. Then press 16) Save Changes. After it saves, press 17) Indexes to go back

enter image description here

Follow steps 5) to 8) again, but this time 18) the recordName field will be set to **Queryable** under Single Field Indexes

enter image description here

like image 39
Lance Samaria Avatar answered Oct 17 '22 10:10

Lance Samaria