Unexpected UpdateContext behaviour

Iron Contributor

Hello, i have this code running on a button click.  For some reason the ClearCollect works fine, and i can access the returned data from MyApi, but the UpdateContext does not work.  If i run the UpdateContext outside the Switch() function it works, but not inside.

 

Any clues?

 

 

UpdateContext({results:""})
Switch(
    var,
    "colGetUser",ClearCollect(colResults,MyAPI.GetUser(user)), <-- This work's fine
    "ctxGetUser",UpdateContext({ctxResults: MyAPI.GetUser(user)}), <-- This doesn't work
    false
);

//UpdateContext({ctxResults: MyAPI.GetUser(user)} <-- This works fine

 

 

1 Reply

@AndrewX 

 

Here's some more interesting behavior. When i have a single ContextUpdate action inside a Switch function everything works fine, but when i have more than 1 ContextUpdate none of them work..