Skip to main content
Participating Frequently
Nov 14, 2021 5:26 PM UTC
Question

store value to ri!available

I'd like to store the value  ri!available using this code

a!integerField(
label: "Available Racks",
labelPosition: "JUSTIFIED",
value: if(isnull(ri!bicycleInfo.stationId),
"",rule!PEDS_QueryStationStatusInfoByStationId(id: ri!bicycleInfo.stationId).availableRacks
),
saveInto: ri!available,
refreshAfter: "UNFOCUS",
readOnly: true,
validations: {}
)

2 replies

Known Participant
Nov 14, 2021 6:40 PM UTC

we can save value to ri!availble on the action on screen. for eg. let just say saveInto of  integer or text field for stationId 

a!integerField(
label: "Station Id",
labelPosition: "JUSTIFIED",
value: ri!bicycleInfo.stationId ,

saveInto: {ri!bicycleInfo.stationId ,

a!save(ri!available,

if(isnull(ri!bicycleInfo.stationId),
"",rule!PEDS_QueryStationStatusInfoByStationId(id: ri!bicycleInfo.stationId).availableRacks
))},
refreshAfter: "UNFOCUS",
validations: {}
),

a!integerField(
label: "Available Racks",
labelPosition: "JUSTIFIED",
value: ri!available,

refreshAfter: "UNFOCUS",
readOnly: true,
validations: {}
)

stefanhelzle0001
Brainy
Nov 14, 2021 6:59 PM UTC

The saveInto is only executed on user interaction. Check the documentation for how to set default values.