Appian Community and Appian Academy are being upgraded. As a part of the upgrade, Appian Community is currently in read-only mode, and user registration is disabled until August 3. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!

The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.

Record Field Id

Certified Lead Developer

Hi everyone Slight smile,

I have scenario where my data is stored in Map/Dictionary.

Now this has to be stored in record.
Each field to be mapped with the respective record field.

Considering the volume, Is there a way to use the Field Id to map the value.
Example:

a!localvariables(


local!list:{
{
columnName:"Name",
recordFieldId"4567898765"
},

{
columnName:"Desc",
recordFieldId"4567856894"
},

/* Now the data to be mapped */
a!foreach(
locaL!list,
index(record,fv!item.recordFieldId,null)
)

)

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    No, you cannot use Field IDs to dynamically map data to records.

    /* Method 1: Direct casting (recommended for volume) */
    cast(
      recordType!YourRecord,
      local!mapData
    )
    
    /* Method 2: Using record constructor */
    recordType!YourRecord(
      recordType!YourRecord.fields.name: local!mapData.name,
      recordType!YourRecord.fields.desc: local!mapData.desc
    )
    
    /* For Bulk Operation */
    
    a!forEach(
      items: local!listOfMaps,
      expression: cast(recordType!YourRecord, fv!item)
    )
    


    Field IDs are internal and not accessible for dynamic referencing. Use field references with dot notation instead.

Reply
  • 0
    Certified Lead Developer

    No, you cannot use Field IDs to dynamically map data to records.

    /* Method 1: Direct casting (recommended for volume) */
    cast(
      recordType!YourRecord,
      local!mapData
    )
    
    /* Method 2: Using record constructor */
    recordType!YourRecord(
      recordType!YourRecord.fields.name: local!mapData.name,
      recordType!YourRecord.fields.desc: local!mapData.desc
    )
    
    /* For Bulk Operation */
    
    a!forEach(
      items: local!listOfMaps,
      expression: cast(recordType!YourRecord, fv!item)
    )
    


    Field IDs are internal and not accessible for dynamic referencing. Use field references with dot notation instead.

Children