Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..

cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in copying related record field value into Cross reference using API

_neha
Contributor II

I am facing issue in copying related record field value into Cross reference using API.

data.Content.FieldContents[fid_Target_Review_Application] = {
"Type": 9,
"Tag": "Review Application",
"Value":[{"ContentId": Number(productregisterfieldArray[135][5]),"LevelId":xxx}], 
"FieldId": fid_Target_Review_Application
},

after converting into JSON showing NAN error for this field.

tried below version as well but unable to set the records in target field

data.Content.FieldContents[fid_Target_Review_Application] = {
"Type": 9,
"Tag": "Review Application",
"Value": productregisterfieldArray[135][5],
"FieldId": fid_Target_Review_Application
},

 

@DavidPetty 

1 ACCEPTED SOLUTION

Accepted Solutions

DavidPetty
Archer Employee
Archer Employee

@_neha the JSON for populating a cross-reference needs to look like this:

"13907": {
        "Type": 9,
        "Tag": "My Contacts (Cross-Reference to Contacts)",
        "Value": [
          {
            "ContentId": 205522
          },
          {
            "ContentId": 318794
          },
          {
            "ContentId": 325672
          }
        ],
        "FieldId": 13907
      }

 Advisory Consultant

View solution in original post

3 REPLIES 3

DavidPetty
Archer Employee
Archer Employee

@_neha the JSON for populating a cross-reference needs to look like this:

"13907": {
        "Type": 9,
        "Tag": "My Contacts (Cross-Reference to Contacts)",
        "Value": [
          {
            "ContentId": 205522
          },
          {
            "ContentId": 318794
          },
          {
            "ContentId": 325672
          }
        ],
        "FieldId": 13907
      }

 Advisory Consultant

Hi @DavidPetty 

here there will we be more than one number(not fixed) of related records in productregisterfieldArray[135][5] this array. 

data.Content.FieldContents[fid_Target_Review_Application] = {
"Type": 9,
"Tag": "Review Application",
"Value": [
{"ContentId": productregisterfieldArray[135][5]},
],
"FieldId": fid_Target_Review_Application
},

I tried it this way but still not working. how to separate it in value section. 

I don't know what language you're writing in, but I suspect you'd have to loop through the productregisterfieldArray array and build the JSON for Value accordingly.

 Advisory Consultant