Appian Community and Appian Academy are being upgraded. From July 24–August 3, the Appian Community will be in read-only mode. During this time, the site will be read-only and user registration will be disabled. 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.

Could not cast from Text to AB_location

local!vehicleBaseLocations: append(local!vehicle,"ALL"),

I have written a rule and called that in local!vehicle(i am fetching data from DB). Am calling that in local!vehicleBaseLocations,I need to add ALL option also, I have used append to achieve it but its throwing error "  Could not cast from Text to AB_location. Details: CastInvalidCould not cast from Text to AB_location. Details: CastInvalid 

Can someone help what exactly am missing

  Discussion posts and replies are publicly visible

  • Your use of append() will need to be adjusted here - what you are attempting to do above is append the text "ALL" into your AB_location CDT which has a different type, generating the mismatch error.  You will want to append a line of type AB_location which includes the "ALL" value, such as:

    a!localVariables(
      local!vehicle: 'type!{urn:com:appian:types}chris_test_cdt'(
        id: 1,
        data: "item1"
      ),
      
      append(
        local!vehicle,
        'type!{urn:com:appian:types}chris_test_cdt'(
          id: null,
          data: "ALL"
        )
      )
    )