Skip to main content
Participating Frequently
November 14, 2021
Question

store value to ri!available

  • November 14, 2021
  • 2 replies
  • 5 views

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
November 14, 2021

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
November 14, 2021

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