Select to view content in your preferred language

How to update Feature's attributes in kotlin sdk

506
1
10-18-2023 06:25 AM
jokerjoker
Occasional Contributor

I use the following code and sometimes it updates properly, but most of the time it doesn't work

kotlin lib version is 200.2.0

 

selectFeature?.attributes?.putAll(FWYT_0(
E_TYPE = eType,
E_DZ = dz.value,
E_XZ = xz.value,
E_NZ = nz.value,
E_BZ = bz.value,
E_FJSM = fjsm
).toMap())
MainScope().launch {
selectFeature!!.featureTable?.updateFeature(selectFeature!!)?.onSuccess {
loadingPopup.dismiss()
ActivityUtils.finishActivity(AttrActivity::class.java)
}
}
Tags (1)
0 Kudos
1 Reply
Shubham_Sharma
Esri Contributor

Hey @jokerjoker , 

 

Could you provide more information or a stacktrace on where the error is occurring? The updateFeature function returns a Kotlin Result, which you can use to retrieve the throwable error if the update fails

onFailure{ exception ->
    // Log exception
}

 

0 Kudos