Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Welcome to the CollectiveAccess support forum! Here the developers and community answer questions related to use of the software. Please include the following information in every new issue posted here:

  1. Version of the software that is used, along with browser and version

  2. If the issue pertains to Providence, Pawtucket or both

  3. What steps you’ve taken to try to resolve the issue

  4. Screenshots demonstrating the issue

  5. The relevant sections of your installation profile or configuration including the codes and settings defined for your local elements.

If your question pertains to data import or export, please also include:

  1. Data sample

  2. Your mapping

Answers may be delayed for posts that do not include sufficient information.

Import mapping: Set object_types based on binary value 0/1

edited March 14 in Troubleshooting
Software version: Providence 1.7.5
Browsers: Latest Chrome (64.0.3282.186) and Firefox (58.0.2) versions
Profile: An adaptation from the SPECTRUM profle

I am trying to set the object_type(s) based on a value in the imported data. De value 0 should change the object type from the default type art in the settings to siteart. (source column 25). The value 1 should leave the default (art)
The list with object types has the id: object_types. The idno for the list items is art, siteart etc.
I have searched the forum for examples of other people trying to do something similar, but have not found a working example.

I have tried:
  • ObjectSplitter: {"objectType": "siteart"}
    tot the CA table element ca_objects.object_types and to the base element ca_objects. That dit not change the object type. Do I need to add a relationship_Type? If so, which type would that be?
  • on the table element ca_objects.object_types, with the option {"skipIfValue": ["1"]} and the replace value from 0 to siteart

I am sure I am missing something here. Can anyone help out?

I have attached the mapping file.


  • edited March 14
    I have found a partial solution:
    The mapping has to be to the table element ca_objects.type_id.
    However, in that case the default setting Type = art seems to be ignored.
    If I add the replacment value 1 to art everything works for now.

    I would prefer finding a way to just change the object type for the condition where the value in the imported data is 0 as this gives me the option the set the object type to another value based on another condition in the imported data (For instance a condition in colum 6 setting the type to other)
    It must be a problem with the option skipIfValue i assume. I have tried {"skipIfValue": [1]} and {"skipIfValue": ["1"]}
  • ca_objects.type_id can take either a numeric type_id value or a type idno (Eg. aka type "code"). You will almost never use numeric type_ids as they're created by the system as types are defined and are not guaranteed to be constant from installation to installation. 

    If your data has arbitrary values that need conversion to type idno's consider using the original and replacement values columns of your import mapping. In the "original" column enter a return-delimited list of values in your data. In the "replacements" enter the type codes, taking care that type codes line up with their counterparts in the original values list. For your situation the original values list would look like:


    And the replacement values woulds be:


    This should be placed on the mapping between ca_objects.type_id and column 25 
  • I have tried the option {"skipIfEmpty":1} and emptied the cells with a value of 1 in the imported data with the same results.
    In the import I get the error Type must be specified for all the rows exept the ones with the value 0.
    It seems that the default type set in the settings is ignored for all data rows if you map to ca_objects.type_id.
  • Yes the default type is there for "type-less" mappings. Once you map type_id that's what's used across the board.
  • edited March 14
    Hello Seth,

    Thanks, so I will have to use one field/cell to set all types. Just a matter of formatting the imported data.
Sign In or Register to comment.